Skip to main content
Participant
March 14, 2007
Question

Retrieving AUTO Increment ID from MYSQL

  • March 14, 2007
  • 1 reply
  • 372 views
Hi All,

I am trying to get the ID issued from MYSQL from an Auto Increment field after an Insert Update command. I keep getting this error....

Warning: mysql_insert_id(): supplied argument is not a valid MySQL-Link resource in /www/mesa/conference/registration/TMP47yo0evkno.php on line 65

Warning: Cannot modify header information - headers already sent by (output started at /www/mesa/conference/registration/TMP47yo0evkno.php:65) in /www/mesa/conference/registration/TMP47yo0evkno.php on line 67

Plus once I get the ID, can someone help with code to pass onto the next page.

Thanks!
This topic has been closed for replies.

1 reply

Inspiring
March 14, 2007
sock_s wrote:
> I am trying to get the ID issued from MYSQL from an Auto Increment field after
> an Insert Update command. I keep getting this error....
>
> Warning: mysql_insert_id(): supplied argument is not a valid MySQL-Link
> resource in /www/mesa/conference/registration/TMP47yo0evkno.php on line 65

It looks as though you're using your remote server as a testing server.
Upload your page to your server and test it there.

The following page shows the correct way to use mysql_insert_id():

http://www.php.net/manual/en/function.mysql-insert-id.php

--
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/