Can you use max within a select function?

This is where I have it...

     $cd_qry = 'select max(code) from equipment';
       $result = mysql_query($cd_qry);
       $temp = mysql_fetch_row($result);
       $bcode = $BCODE_START . str_pad((substr($temp[0], -6) + 

However, I'm getting an error that says "Supplied argument is not a valid 
MySQL result resource in 
/usr/local/nusphere/apache/htdocs/ese-lab/Protect/add.php3 on line 
162".  The line beginning with $temp is line 162... would this be why?

I'm using MySQL 3.23.33 and PHP 4.0.4 .



PHP Database Mailing List (
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to