[nycphp-talk] mysql_insert_id Strangeness
Jerry Kapron
nyphp at NewAgeWeb.com
Tue Aug 5 10:15:34 EDT 2003
Russ Demarest wrote:
>$sql = "INSERT into table blah blah";
>$res = mysql_query($sql) or die("Error insert");
>$new_id = mysql_insert_id($res); # The $res is not needed, it default
>to the last result set returned.
Russ,
That's wrong. The optional parameter that mysql_insert_id() takes should be the database connection identifier and NOT the result resource returned by the mysql_query() function.
Jerry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20030805/ab091d11/attachment.html>
More information about the talk
mailing list