Resource id #34
| From: | Will Macdonald | Date: | Wed, 24 May 2000 16:26:55 +0000 |
| Subject: | Resource id #34 | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-437@lists.php.net to get a copy of this message | ||
Hi,
I have this strange priblem when trying to get the maximum value from a
MySQL database column..
The code in question is this:
$MaxThread = "SELECT MAX(Thread) AS Thread FROM message";
$MaxThreadVal = mysql_query($MaxThread, $mysql_link);
I want to increment the value held by $MaxThreadVal by one.
print $MaxThreadVal;
$MaxThreadVal++;
print $MaxThreadVal;
For debugging purposes I am printing before and after. However, I get
Resource id #34 returned.
I have checked the code with MySQL client and it works fine, returning
the correct value. I am tailing the MySQL log and the following code is
being passed to MySQL:
933 Query SELECT MAX(Thread) AS Thread FROM message
I have many other SQL queries running in my code and they all work as
they should.
Can some one explain what this Resource id #34 means. I have tried
searching with little success.
Setup: Linux Mandrake, MySQL 3.23, PHP4.0, Zend Opt B4, Apache 1.3.12.
PHP compiled as module.
Thanks
Will
--
mailto:wfm@macscan.co.uk
http://www.williammacdonald.com