mysql link resource error on php 4.0.6
| From: | Rafael | Date: | Fri, 26 Oct 2001 15:28:41 +0000 |
| Subject: | mysql link resource error on php 4.0.6 | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-69070@lists.php.net to get a copy of this message | ||
Hi All..
I don't have very knowledge about php source code, but I've noticed that, in
version 4.0.6, the mysql support has beed rewriten ( or at least, part of the
code ). The problem is that now, I'm getting some strange errors when calling
mysql_query() using the link resource parameter as a global variable. For
example, with php 4.0.1, I've a code like this:
$GLOBALS["CONNECTION_ID"] = mysql_connect("blah", "blah",
"bla");
echo $GLOBALS["CONNECTION_ID"]; // prints Resource id #1
so, when I call
$result = mysql_query("select * from some_table", $GLOBALS["CONNECTION_ID"])
it works fine!! but, with php 4.0.6, I got an error like
Warning: 1 is not a valid mysql link resource at file.php, line xxx
Looking to php source code, the mysql_query funciont has changed to a
function called php_do_mysql_query ( that calls php_do_mysql_general, or
something like it )..
well... I'm only got this error with php version 4.0.6, runing on a linux box
with debian 2.2, mysql 3.22.23
Thanks for any information..
Rafael Steil