I'm trying to get a script working that will upload an image to a MySQL 
database ... the script seems to be working, in that its not giving errors 
- but it does nothing ... it doesn't add the image to the database at all.

Can someone take a look at this script and let me know where I've gone wrong?


Here is the script I'm using:


if ($submit) {


     $data = addslashes(fread(fopen($form_data, "r"), filesize($form_data)));

     $result=MYSQL_QUERY("INSERT INTO binary_date 
(description,bin_data,filename,filesize,filetype) ".

     $id= mysql_insert_id();
     print "<p>This file has the following Database ID: <b>$id</b>";


} else {

     // else show the form to submit new data:

     <form method="post" action="<?php echo $PHP_SELF; ?>" 
     File Description:<br>
     <input type="text" name="form_description"  size="40">
     <INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="1000000">
     <br>File to upload/store in database:<br>
     <input type="file" name="form_data"  size="40">
     <p><input type="submit" name="submit" value="submit">




PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to