Hey all,
I’m sure this is just a rookie mistake, but I can’t seem to find a way around it. Perhaps someone can take a look and help me with a resolve:
[CODE]
while ($row = mysql_fetch_array($result))
{
if ($row[‘movieID’] == $movieID)
{
$match = “y”;
}
}
if ($match != “y”)
{
echo $movieID . ” is not a valid movie ID – No delete made ***<br /><br />”;
include ‘footer.html’;
die ();
}
mysql_query(“DELETE FROM dvd WHERE movieID = ‘$movieID'”)
or exit(“<p>Error – Unable to execute query</p>”);
echo $movieID . ” was successfully deleted ***”;
mysql_close($DBconnect);
What’s happening is that when you FIRST load the page, it gives a warning saying ” is not a valid movie ID – No delete made ***” because when the page first loads $match does NOT = ‘y’.
Is there a way around this? I’ve tried making $match = 0 and putting an if statement that if $match = 0 then die (); but that just gives the warning of ” was successfully deleted”.
I’m so lost and frustrated. Any suggestions are greatly appreciated.
Thanks all,
TriZz