Code: Select all
<?php
/* Database connection stuff
$tst is set to table name depending on the table the image is being uploaded for and $image_column is set to the image that is being updated image1 to image5, column for each one */
$query="UPDATE $tst SET $image_column ='$new_file_name' WHERE ID=$ID AND client='$client' LIMIT 1";
if (!mysql_query($query,$connection)) {
echo "Connection error";
}else{
if (mysql_affected_rows() >0) {
echo "Rows where updated";
} else {
echo "Rows where not updated";
}
}
?>