PHP/MySQL Noob...
PHP/MySQL Noob...
- Started
- Last post
- 5 Responses
- gabriel_pc
is it possible to get the auto generated id of a new record as soon as it's created? what I'm trying to do is rename an uploaded file based on a record id that was created at the same time? So if you uploaded a jpg it would rename the file to "Image_".$recordid.".jpg"
Thanks!
- chimchim0
LAST_INSERT_ID()
- gabriel_pc0
awesome! +1 to chimchim
- chimchim0
np...I happen to remember it from a week ago..and it was in my handy MySQL pocket O'Reilly book...
you should grab a copy.
- sparker0
why aren't you changing the name before putting the data in the database?
- gabriel_pc0
I'm basing the name of the image off of the record id in the mysql table.