我正在尝试编写要在 MySQL 中删除的行。
我不知道如何做到这一点,所以从另一个网站上挑选了一些编码:
句法:
<?php
$personID=$_GET["q"];
if ($personID<="0"){echo( "<center><h3><a href=\"#\" onclick=\"window.close(); return false\">NO ID ERROR CLICK THIS TO RETRY CLOSE WINDOW</a></h3></center>");
}
else
{
$con = mysql_connect("mysql.XXX.com","XXX","XXX");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$myid=$_COOKIE["user"];
@mysql_select_db("u716720408_admin", $con)or die( "Unable to select database");
$result=mysql_query("DELETE * FROM users WHERE personID=$personID")or die(mysql_error());
$cnt=1;
$row = mysql_fetch_array( $result );
$f1=$row['personID'];
$f2=$row['personFname'];
$f9=$row['llmail'];
$f14=$row['personSname'];
$f19=$row['password'];
?>