Reply to Re: Insert image into a database

Re: Insert image into a database new!
by Andrea, 16 years, 9 months ago
I'm actually using this code:

if ($handle->processed) {
  // everything was fine !
  echo 'file uploaded with success';
  echo '';
  $info = getimagesize($handle->file_dst_pathname);
  echo '  ' . $info['mime'] . ' '. $info[0] . ' x ' . $info[1] 
    .' - ' . round(filesize($handle->file_dst_pathname)/256)/4 . 'KB';
  echo 'Image Uploaded!';
  $idprogetto=$_POST["idprogetto"];
  $caption=$_POST["caption"];
  $buy=$_POST["buy"];
  $insert="INSERT INTO `images` (id,idproject,caption,buy,link)".
   "    VALUES (' ','$idproject','$caption','$buy',".
   "'".$handle->file_dst_name."')";
  $risult=mysql_query($insert, $link);
}
Reply

Your reply

Name *
Email 
Title *
Text *
CAPTCHA image
Enter the code displayed on the image:
Click on the image to generate another one if it is hard to read it. The case is important