Hi All
I’m having a spot of bother with a delete statement, it works, as in there are no errors, but there is something wrong as it won’t delete the record in the MYSQL database, shown below is the form:
<form action=co_delete.php method=post/>
<input name=photo_id type=text value=" . $pid['photo_id'] . ">
<input type=submit name=delete value=Delete />
</form>
$pid is the assigned variable for dealing with the file id
<?php
// Get the configuration data
$connect = require_once('../Connections/ilikeyours.php');
//Connect to mysql server
$link = mysql_connect($hostname_ilikeyours, $username_ilikeyours, $password_ilikeyours);
if(!$link) {
die('Failed to connect to server: ' . mysql_error());
}
//Select database
$db = mysql_select_db($database_ilikeyours);
if(!$db) {
die("Unable to select database");
}
$pid = $_POST['photo_id'];
$remove_pic = ("DELETE FROM gallery_photos WHERE photo_id = '$pid'");
mysql_query($remove_pic) or die(mysql_error());
echo "Picture Deleted
<a href=co_recentpics.php> Click here</a> to go back to the pictures";
?>
As already mention this does not work for some reason any ideas?