I am not getting an error. I get "your image has been uploaded". But when I go to the database the old image is there, nothing has changed.
M update page code:
<?php require_once('../Connections/mydatabase.php'); ?>
<?php
$colname_image = "-1";
if (isset($_GET['username'])) {
$colname_image = (get_magic_quotes_gpc()) ? $_GET['username'] : addslashes($_GET['username']);
}
mysql_select_db($database_mydatabase, $mydatabase);
$query_image = sprintf("SELECT * FROM binary_data WHERE username = '%s'", $colname_image);
$image = mysql_query($query_image, $mydatabase) or die(mysql_error());
$row_image = mysql_fetch_assoc($image);
$totalRows_image = mysql_num_rows($image);
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<p>Image uploaded for: <?php echo $row_image['username']; ?>
<?php
// code that will be executed if the form has been submitted:
if ($submit) {
// connect to the database
mysql_select_db($database_mydatabase, $myspace);
$data = addslashes(fread(fopen($form_data, "r"), filesize($form_data)));
$result=MYSQL_QUERY("UPDATE binary_data SET(bin_data,filename,filesize,filetype) ".
"VALUES ('$data','$form_data_name','$form_data_size','$form_data_type')");
print "<p>Your image has been uploaded";
MYSQL_CLOSE();
} else {
?></p>
<p><form method="post" action="<?php echo $PHP_SELF; ?>" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="1000000">
<table width="300" border="0" cellspacing="0" cellpadding="0"><tr>
<td align="right">Image:</td>
<td><input type="file" name="form_data" size="40"></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="submit" value="submit" ></td>
</tr>
</table>
<br>
<br>
<p>
</form></p>
<?php
}
?>
</body>
</html>
<?php
mysql_free_result($image);
?>
I don't know what else to do. Please help