I have been working on this a while and have tried just about way trying to delete a row from a database using a button. What I have is a list of websites and data about each on each row. Then next to the row is a Delete button. I just want it to delete that one row and refresh the page when clicked. I already have the table made but when I click the button, it just refreshes the page but nothing happens.
I have tried different things but here is what I have now. I know it is terribly wrong.
echo '<form action="'.$_SERVER['PHP_SELF'].'" method="post">';
echo '<input type="submit" name="delete" value="Delete ">';
break;
case 'delete';
{
$sql = "DELETE FROM UserSites WHERE 'SiteNumber'=$SiteNumber";
$result = mysql_query($sql);
echo "Site deleted!";
}
I know I need to include SiteNumber somewhere in my button code. Any help would be greatly appreciated!