Not sure whats happening with me tonite but I can't seem to delete from a mysql database. The script doesn't throw any errors and I can't see anything wrong......theres no problems with permissions or anything like that.
Perhaps someone else can see the problem which is no doubt right in front of me...
<?php
$dbhost = "localhost";
$dbuser = "root";
$dbpass = "";
$dbname = "hands_off";
$db = mysql_connect($dbhost,$dbuser,$dbpass);
mysql_select_db("hands_off",$db);
if($add)
//we are adding
{
mysql_query("INSERT INTO songlist (artist,title) VALUES ('$artist','$title')");
}
if($delete)
//we are deleting
{
mysql_query("DELETE * from songlist WHERE title = '$title'");
}
if($update)
//we are updating
{
mysql_query("UPDATE songlist SET title='$title',artist='$artist' WHERE title='$old_title'");
}
//now get results
$query = mysql_query("SELECT * FROM songlist");
while($row = mysql_fetch_row($query))
{
//get columns
$artist = $row[0];
$title = $row[1];
print ("<tr>\n<td><font face='arial' size='2'>$title</font></td>\n");
print ("<td><a href='edit_song.php3?title=$title'><font size=2'>Edit</font></a></td>\n");
print ("<td><a href='delete_song.php3?title=$title'><font size='2'>Delete</font></a></td>\n</tr>");
}
?>
Any ideas....?
regards,
scott d~