hello friends,
I am trying to upload image in to database but its not working
Iam working this in Win XP .is there any changes to be made with
php.ini file pls mension the changes to be made in .ini file i had tried lot of codes i took this code from phpbuilder if u have any other code pls send me and help me.
thanx and regards,
Nanban.
<?php
if ($submit) {
MYSQL_CONNECT("localhost","root","");
mysql_select_db("image");
$data = addslashes(fread(fopen($form_data, "r"), filesize($form_data)));
echo $data;
exit;
$result=MYSQL_QUERY("INSERT INTO binary_data (description,bin_data,filename,filesize,filetype) ".
"VALUES ('$form_description','$data','$form_data_name','$form_data_size','$form_data_type')");
$id= mysql_insert_id();
print "<p>This file has the following Database ID: <b>$id</b>";
MYSQL_CLOSE();
}
else
{
?>
<form method="post" action="<?php echo $PHP_SELF; ?>" enctype="multipart/form-data">
File Description:<br>
<input type="text" name="form_description" size="40">
<INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="10000000000">
<br>File to upload/store in database:<br>
<input type="file" name="form_data" size="40">
<p><input type="submit" name="submit" value="submit">
</form>
<?php
}
?>