Matthew Oatham wrote:

The idea was that the user uploads a file and I insert details about the
file into the mysql table and rename the file using the generated id.


Even with this scenario you probably can do with out the extra column as John has suggested.

so if the next primary key is 4 I generate the file id CR-004 and rename the
uploaded file to CR-004 whilst also storing CR-004 in the table.


You are still following a pattern. COuld you perhaps clarify if CR is common for all users or do you choose a different prefix for different users. If you do use different combinations of letters yes you might need a different field and then the solution would be what Robert suggested mysql_insert_id() you will need to use an update an update query where the condition has the insert id returned by this call.

Thanks for your ideas so far - very useful! How do you get to know about all
these useful functions?


by RTFM. :-)

Cheers

Matt
-----


--
Raditha Dissanayake.
---------------------------------------------
http://www.radinks.com/print/upload.php
SFTP, FTP and HTTP File Upload solutions


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



Reply via email to