Hi - can anyone spot the obvious mistake in this code?
I am trying to assign an id number to my fotos to make sure that they are not over written. I saw somewhere that suggested I try using $id = mysql_insert_id($conn); but I am not really sure what $id is actually pulling out and if this is indeed a unique number.
Maybe I am totally on the wrong track. I tried using the $id_user from the data base but if I understand things correctly the php form doesn't necessaritly have this data.
$conn=mysql_connect($dbhost, $dbuser, $dbpassword) or die ("Could not connect to database");
mysql_select_db($dbname, $conn) or die ("Could not select $dbname database");
$id = mysql_insert_id($conn);
$newfotoname = $foto_name.$id;
if ($foto_type == "image/pjpeg")
{
copy($foto, "../fotos_coches/".$newfotoname);
}