On Sat, 25 Oct 2003 20:31:37 -0200, you wrote: >When I enter: > > SELECT MAX(quotation_id)+1 from quotations > > I get simply the number 7 (which is ok) > > But when I do: > > $new_key = mysql_query("SELECT MAX(quotation_id)+1 from quotations") > > I get $new_key = Resource id #3
Long answer: you need to read the manual pages for mysql_query. The function doesn't return data, it returns a database connection from which you can recover the data. Short answer: $rs = mysql_query("SELECT MAX(quotation_id)+1 from quotations"); $row = mysql_fetch_row ($rs); print_r ($row); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php