Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

maxdb_errno(3) [php man page]

MAXDB_ERRNO(3)								 1							    MAXDB_ERRNO(3)

maxdb_errno - Returns the error code for the most recent function call

       Procedural style

SYNOPSIS
int maxdb_errno (resource $link) DESCRIPTION
Object oriented style int$maxdb->errno () The maxdb_errno(3) function will return the last error code for the most recent MaxDB function call that can succeed or fail with respect to the database link defined by the $link parameter. If no errors have occurred, this function will return zero. RETURN VALUES
An error code value for the last call, if it failed. zero means no error occurred. EXAMPLES
Example #1 Object oriented style <?php $maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { printf("Connect failed: %s ", maxdb_connect_error()); exit(); } if (!$maxdb->query("SELECT xxx FROM hotel.city")) { printf("Errorcode: %d ", $maxdb->errno); } /* close connection */ $maxdb->close(); ?> Example #2 Procedural style <?php $link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { printf("Connect failed: %s ", maxdb_connect_error()); exit(); } if (!maxdb_query($link, "SELECT xxx FROM hotel.city")) { printf("Errorcode: %d ", maxdb_errno($link)); } /* close connection */ maxdb_close($link); ?> The above example will output something similar to: PHP Warning: maxdb_query(): -4005 POS(8) Unknown column name:XXX [42000] <...> Errorcode: -4005 SEE ALSO
maxdb_connect_errno(3), maxdb_connect_error(3), maxdb_error(3), maxdb_sqlstate(3). PHP Documentation Group MAXDB_ERRNO(3)

Check Out this Related Man Page

MAXDB_INFO(3)								 1							     MAXDB_INFO(3)

maxdb_info - Retrieves information about the most recently executed query

       Procedural style

SYNOPSIS
string maxdb_info (resource $link) DESCRIPTION
Object oriented style string$maxdb->info () The maxdb_info(3) function returns a string providing information about the last query executed. The nature of this string is provided below: Possible maxdb_info return values +---------------------------------------+----------------------------------------------+ | Query type | | | | | | | Example result string | | | | +---------------------------------------+----------------------------------------------+ | INSERT INTO...SELECT... | | | | | | | Records: 100 Duplicates: 0 Warnings: 0 | | | | |INSERT INTO...VALUES (...),(...),(...) | | | | | | | Records: 3 Duplicates: 0 Warnings: 0 | | | | | LOAD DATA INFILE ... | | | | | | | Records: 1 Deleted: 0 Skipped: 0 Warnings: 0 | | | | | ALTER TABLE ... | | | | | | | Records: 3 Duplicates: 0 Warnings: 0 | | | | | UPDATE ... | | | | | | | Rows matched: 40 Changed: 40 Warnings: 0 | | | | +---------------------------------------+----------------------------------------------+ Note Queries which do not fall into one of the above formats are not supported. In these situations, maxdb_info(3) will return an empty string. RETURN VALUES
A character string representing additional information about the most recently executed query. EXAMPLES
Example #1 Object oriented style <?php $maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { printf("Connect failed: %s ", maxdb_connect_error()); exit(); } $maxdb->query("CREATE TABLE temp.t1 LIKE hotel.city"); /* INSERT INTO .. SELECT */ $maxdb->query("INSERT INTO temp.t1 SELECT * FROM hotel.city"); printf("%s ", $maxdb->info); /* close connection */ $maxdb->close(); ?> Example #2 Procedural style <?php $link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { printf("Connect failed: %s ", maxdb_connect_error()); exit(); } maxdb_query($link, "CREATE TABLE temp.t1 LIKE hotel.city"); /* INSERT INTO .. SELECT */ maxdb_query($link, "INSERT INTO temp.t1 SELECT * FROM hotel.city"); printf("%s ", maxdb_info($link)); /* close connection */ maxdb_close($link); ?> The above example will output something similar to: Records: 25 Duplicates: 0 Warnings: 0 SEE ALSO
maxdb_affected_rows(3), maxdb_warning_count(3), maxdb_num_rows(3). PHP Documentation Group MAXDB_INFO(3)
Man Page