Search code examples
phpmysqlwarningsmysql-insert-id

Call to mysql_insert_id gives warning


Hi I'm receiving this warning when trying to retrieve the insert id

Warning: mysql_insert_id(): supplied argument is not a valid MySQL-Link resource

in

mysql_query($importword); 
$word_id = mysql_insert_id($importword);

Solution

  • if you get the id and that id you want to insert just write mysql_insert_id(); after your query.