DavÝ­ Írn Jˇhannsson wrote:
I have a situation where I allow users to upload images, and I store the
names of the images in a database and the images I store in a some
folder on the server, but what I would like to do is to dynamically
create names for the images and dont ever have to worry about if this
name exists and with out having to got to the trouble of asking the user
to change tha name of the file.
So dose some one have a nice litle solution for this problem.
Thanks, David

Insert your file-info into the database
Use mysql_insert_id() (or similar) to get the ID of your new row. (You do have an auto_increment column, right?)
Use that ID as filename.

Regards
Joakim Andersson


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to