I got this straight out of my PHP book yet regardless of the value of $userid it ALWAYS comes out TRUE ($result=1). Is there a typo in my book? The code does work when the userid is correct.
$selstate = "DELETE from userdb WHERE username = '$userid'";
$result = mysql_query($selstate,$linkID);
if ($result == TRUE) {
print "<p>The record was successfully deleted.\n";
}
else {
print "<p>No such record with that UserID. Please check and try again.\n";
}
mysql_close($linkID);
$selstate = "DELETE from userdb WHERE username = '$userid'";
$result = mysql_query($selstate,$linkID);
if ($result == TRUE) {
print "<p>The record was successfully deleted.\n";
}
else {
print "<p>No such record with that UserID. Please check and try again.\n";
}
mysql_close($linkID);