PHP maxdb_warning_count function
Like this blog? Consider exploring one of our sponsored banner ads...
maxdb_warning_count
(PECL)
maxdb_warning_count(no version information, might be only in CVS)
maxdb->warning_count — Returns the number of warnings from the last query for the given linkDescriptionProcedural style:
int maxdb_warning_count ( resource link )Object oriented style (property):
class maxdb {int warning_count
}
maxdb_warning_count() returns the number of warnings
from the last query in the connection represented by the
link parameter.
Number of warnings or zero if there are no warnings.
maxdb_errno(),
maxdb_error(),
maxdb_sqlstate()
Example 1. Object oriented style
$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();
Example 2. Procedural style
$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);
The above examples would produce the following output:
Number of warning: 0
About this entry
You’re currently reading “PHP maxdb_warning_count function,” an entry on BRADINO
- Published:
- 2.26.07 / 12am
- Category:
- PHP Functions
- Tags:
No comments
Jump to comment form | comments rss [?] | trackback uri [?]