> database ... the script seems to be working, in that its not giving errors

You're not asking it to give you error messages :-)

> <?php
>
> if ($submit) {
>
>      MYSQL_CONNECT("localhost","user","pass");

... or die("Could not connect to database")

>      mysql_select_db("binary_date");

... or die("Could not select binary_date");

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

This is pretty scary...

You'll have to tear this apart into several lines to get any useful error
messages...

$file = fopen($form_data, 'r') or die("Could not open $form_data");
$size = filesize($form_data) or die("Could not get size of $form_data");
# php.net doesn't say what fread returns in the event of a failure...
# Let's assume nobody is uploading an empty file:
$rawdata = fread($file, $size) or die("Could not read data from
$form_data");
$data = addslashes($rawdata);

>      $result=MYSQL_QUERY("INSERT INTO binary_date
> (description,bin_data,filename,filesize,filetype) ".
>          "VALUES
>
('$form_description','$data','$form_data_name','$form_data_size','$form_data
_type')");

or die("Query Failed");

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

Is this printing a non-zero ID?...

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
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