cvs: php-src /ext/mysql/tests mysql_errno.phpt
| From: | Ulf Wendel | Date: | Thu, 12 Jul 2007 13:57:36 +0000 |
| Subject: | cvs: php-src /ext/mysql/tests mysql_errno.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-45291@lists.php.net to get a copy of this message | ||
uw Thu Jul 12 13:57:36 2007 UTC
Modified files:
/php-src/ext/mysql/tests mysql_errno.phpt
Log:
A bit more verbose message in case of problems. It's been helpful to
debug a cross-server version issue.
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_errno.phpt?r1=1.2&r2=1.3&diff_format=u
Index: php-src/ext/mysql/tests/mysql_errno.phpt
diff -u php-src/ext/mysql/tests/mysql_errno.phpt:1.2 php-src/ext/mysql/tests/mysql_errno.phpt:1.3
--- php-src/ext/mysql/tests/mysql_errno.phpt:1.2 Wed Jul 11 12:57:57 2007
+++ php-src/ext/mysql/tests/mysql_errno.phpt Thu Jul 12 13:57:36 2007
@@ -38,8 +38,12 @@
if ($link = @mysql_connect($host . '_unknown', $user . '_unknown', $passwd,
true)) {
printf("[005] Can connect to the server using host=%s, user=%s, passwd=***, dbname=%s,
port=%s, socket=%s\n",
$host . '_unknown', $user . '_unknown', $db, $port, $socket);
+} else {
+ $errno = mysql_errno();
+ if (!is_int($errno))
+ printf("[006] Expecting int/any (e.g 1046, 2005) got %s/%s\n", gettype($errno),
$errno);
+
}
-var_dump(mysql_errno());
print "done!";
?>
@@ -49,5 +53,4 @@
Warning: mysql_errno(): %d is not a valid MySQL-Link resource in %s on line %d
bool(false)
-int(%d)
done!
\ No newline at end of file