I’m trying to make this code delete a row from this table, but i get these errors. If I remove my $action tag. then $IDnum causes an error. Sorry for the dumb question, still learning php =}
if ($action == "deletead") { // remove AD
mysql_query("DELETE FROM ads where ID = '$IDnum'") or die(mysql_error());
$i=$i++;
}
$letknown = "<b>User account removed</b><br>";
echo "<div class=\"adcode\"><b>$ID : $adname</b><br /><a href=\"?action=deletead&IDnum=$ID\">Delete Ad</a><br /><br />$adcode</div><br />\n";
echo "<br /><hr />";
Notice: Undefined variable: action in C:\Program Files (x86)\Zend\Apache2\htdocs\adgate\displayads.php on line 38
Notice: Undefined variable: IDnum in C:\Program Files (x86)\Zend\Apache2\htdocs\adgate\displayads.php on line 39
code your structure properly like this and use $_GET[‘action’] for getting url parameter