Product Documentation

FairCom SQL for PHP

Previous Topic

Next Topic

ctsql_error

Returns the text of the error message from previous c-treePHP operation.

Declaration

string ctsql_error ()

Returns

Returns the error text from the most recently executed c-treePHP function, not including ctsql_error() and ctsql_errno(). An empty string is returned if no error occurred.

Example


<?php

$link = ctsql_connect("ctreeSQL", "admin", "ADMIN");

if (!$link) {

echo ctsql_errno() . ": " . ctsql_error(). "\n";

}


if (!ctsql_query("SELECT * FROM nonexistenttable", $link)) {

echo ctsql_errno() . ": " . ctsql_error() . "\n";

}

?>


The above example would produce the following output:

-20005: Table/View/Synonym not found

See also

ctsql_errno()

TOCIndex