 <p>The argument passed to <code>mysql_insert_id</code> is the resource of a database connection. You're feeding it the result of a MySQL query. Just <code>mysql_insert_id()</code> by itself <em>should</em> work unless you're opening multiple database connections. </p> <p><a href="http://us3.php.net/mysql_insert_id">http://us3.php.net/mysql_insert_id</a></p>