Portal Home > Knowledgebase > Articles Database > Using an id that was generated via auto incrementation using "null"


Using an id that was generated via auto incrementation using "null"




Posted by FinalFrontier, 11-22-2011, 08:11 AM
I remember reading about a PHP operator that will allow me to use information from a previous MySQL entry or something. What I am doing is executing this via PHP: Then later on in the script I need to use: Where "XXXX" is the id. "id" is auto incrementing which is why I used "null" in the first query. So, I need to use the id number that was incremented. What was that PHP operator again??

Posted by foobic, 11-22-2011, 09:30 AM
http://php.net/manual/en/function.mysql-insert-id.php

Posted by FinalFrontier, 11-22-2011, 10:40 AM
Ah har, so thats what I need! Thanks for the link to the operator, Chris.

Posted by Joseph_M, 11-22-2011, 03:07 PM
It's worth considering using MySQLi instead, it's OO, allows for prepared statements, multiple statements, transactional use etc. VERY handy.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
Syn flood help (Views: 576)


Language: