Ok, this is sort of an odd request, so let me try to explain it as best as I can. I have a user-system that, among other things, lets users upload pictures to the website.
The user's picture will be stored at [primary key of user's record in MySQL database].[jpg or gif]. I, somehow, need to know the primary key number of the user's record in the database ahead of time in order to rename the image on the server to it.
I cannot simply do the INSERT query first, then search for that record because one of the fields in the record would be the url to the image (ie: www.site.com/25.jpg).
I don't know if this is universal behavior or not, but in my MySQL server, if you delete a record, it will forever skip that record's key upon INSERT querys, so I cannot simply find the greatest key and then add one to that to find the next key number.
Ok, thats it. I know this is complicated, but if you could help I would really appriciate it.
Thanks in advance.