|
Posted by x0054 on 07/14/06 18:56
Ok, this is a stupid problem, I admit. I have a scrip that adds records to
a table. The records are for photos. So, after adding a record the scrip
also uploads a picture from users computer and renames it to
{$recordID}.jpg.
The problem is, my recordID field is auto incrementing in mySQL. So
currently I just take the last added record and assume that it the one I
just added, and rename the file to the recordID of that record. It works,
but clearly isn't the best way to do this as 2 users can add records at the
same time and then I would have a problem.
So what I am wondering is if there is a way to write a record to mySQL and
then have mySQL return recordID of the record just written?
- Bogdan
[Back to original message]
|