Can anyone help for this. In my project i uploaded files by using this query
@list(, , $imtype, ) = getimagesize($_FILES[‘photo’][‘tmp_name’]);
// Get image type.
// We use @ to omit errors
if ($imtype == 3) // cheking image type
$photo_ext=“png”; // to use it later in HTTP headers
elseif ($imtype == 2)
$photo_ext=“jpeg”;
elseif ($imtype == 1)
$photo_ext=“gif”;
if($photo!=‘’){ $db->execute(“UPDATE emp_personal SET photo=‘$photo’, photo_ext=‘$photo_ext’ WHERE emp_id =‘$emp_id’”);}
Upto some days it worked but, now it didn’t give error and files are not uploaded. In this code files are not transfer to any folder only insert into database and accessed by some php code.
why this problem comes, any limit in saving or what reason can anyone suggest??
The code you posted will insert the actual image into a database but won’t save the image file anywhere. Is there more that you haven’t shown? If they’re being inserted into the database OK then the upload is working, at least partially.
but i don’t know for which reason i didn’t see the photos.
can u say that on which reasons a file can’t upload?? i didn’t get the reason, when i upload a image it didn’t see on action page…
OK, I think I see what you mean. The first thing I would do is output $_FILES on your upload page to see what’s there:
print_r($_FILES);
It sounds like the upload is failing for some reason but by default it won’t notify you. $_FILES will show you if there are any errors, and if not it might give a clue as to what is happening.
From there I would output the content of $imtype and $photo to see how far it is getting before something fails.
$signature = mysql_real_escape_string($signature);
this line comes before print_r($_FILES); but, when i echo the signature variable it shows blank… how it can possible…
i didn’t understand that, why the problems come… can u help me for this.