how do we attach mysql_insert_id() in a file uploads so that each file gets unique name ? I did try the following code but didn’t work. please advice. Yhanks
$id = mysql_insert_id();
$dest = trim($uploaddir. $id. basename($_FILES['photo']['name']));
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This should be
You should write your code so you add the file to the directory before you add to database.
$_FILESSize,Ext,Headers,NameUniqueIDand create a hash from a static string, Example1Example 1:
Store file like
HASH.ext