mysql_insert_id() Basics

Asked recently on Yahoo! Answers:

Help what do I do? It’s a MySql error… on connecting through php?
Warning: mysql_insert_id(): A link to the server could not be established in /home/www/cwc-3d.awardspace.com/admincp/… on line 163

ok. how do i insert the id for the MySql database i cannot figure this out.. PLEASE HELP!!!

You’re probably misusing mysql_insert_id().

That function returns the unique key from the last insert operation. You don’t use it to insert records; you use it to get back from the database the record id of the newly inserted records.

Also, it does sound like you are passing bad credentials to the MySQL server.

View this code sample:


Related Posts

No related posts.

Comments Closed

Comments are closed for this post. If you have questions, would like assistance, or otherwise would like to discuss this post, please contact me directly.