(PECL maxdb >= 1.0)
Returns the number of warnings from the last query for the given link
int maxdb_warning_count ( resource $link )
Procedural style
Object oriented style
int $maxdb->warning_count;
maxdb_warning_count() returns the number of warnings from the last query in the connection represented by the link
parameter.
Returns:
Number of warnings or zero if there are no warnings.
Examples:
Object oriented style
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | <?php $maxdb = new maxdb( "localhost" , "MONA" , "RED" , "DEMODB" ); /* check connection */ if (maxdb_connect_errno()) { printf( "Connect failed: %s\n" , maxdb_connect_error()); exit (); } $maxdb ->query( "CREATE TABLE temp.mycity LIKE hotel.city" ); /* a remarkable city in Wales */ $query = "INSERT INTO temp.mycity (zip, name) VALUES( '11111' , 'Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch' )"; $maxdb ->query( $query ); printf ( "Number of warning: %d\n" , $maxdb ->warning_count); /* close connection */ $maxdb ->close(); ?> |
Procedural style
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | <?php $link = maxdb_connect( "localhost" , "MONA" , "RED" , "DEMODB" ); /* check connection */ if (maxdb_connect_errno()) { printf( "Connect failed: %s\n" , maxdb_connect_error()); exit (); } maxdb_query( $link , "CREATE TABLE temp.mycity LIKE hotel.city" ); /* a remarkable long city name in Wales */ $query = "INSERT INTO temp.mycity (zip, name) VALUES( '11111' , 'Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch' )"; maxdb_query( $link , $query ); printf ( "Number of warning: %d\n" , maxdb_warning_count( $link )); /* close connection */ maxdb_close( $link ); ?> |
See also:
Please login to continue.