PHP gevorderde |
|
<?php
$beginid = $_REQUEST['$id'];
$id = strtolower($beginid);
// En dan gewoon wat je wilde deleten:
$deletequery = "DELETE FROM `games` WHERE `id`='$id';
mysql_query($deletequery) OR die("Kon query niet uitvoeren". mysql_error());
?>
wordt dus:
<?php
$sDeleteQuery = "DELETE FROM games WHERE id = '" . intval($_POST['id']) . "'";
if(!mysql_query($sDeletequery, $rJeDatabase)
{
echo 'Kon ' . htmlspecialchars($sDeleteQuery) . ' niet uitvoeren, MySQL gaf terug: ' . mysql_error();
}
else
{
echo 'Joepie, gelukt!';
}
?>
<?php $sDeleteQuery = "DELETE FROM games WHERE id = '" . intval($_POST['id']) . "'"; { } else { } ?>
|