Please help...
have created this script to delete stuff from a database table and it works correctly, ie, only deletes if the right id number and password is submitted....BUT if the password or id is incorrect it still throws back the first IF message.
I have tried replacing the if ($Query) with if ($Result) and it still does the same thing.
here is the full page script:
<HTML>
<HEAD>
<TITLE> CREATING A DATABASE</TITLE>
</HEAD>
<BODY>
<?PHP
//trim the incoming data
$Array[Remove] = trim
($Array[Remove]);
$Array[iDRemove] = trim
($Array[iDRemove]);
//set the variables for the database connection:
$Host = \"localhost\";
$User = \"\";
$Password = \"\";
$DBName = \"\";
$TableName = \"\";
//have removed above info for obvious reasons!.
$Link = mysql_connect ($Host, $User, $Password);
$Query = \"DELETE FROM $TableName
WHERE Password = \'$Array[Remove]\'AND id= \'$Array[iDRemove]\'\";
$Result = mysql_db_query ($DBName, $Query, $Link);
if ($Query){
print(\"Please check to see if your item has been removed.<BR> If it still appears then either a wrong ID was used or your Password was incorrect.\");
} else {
print(\"no\");
}
mysql_close ($Link);
?>
<br><br>
<b><font size=\"2\" face=\"Arial, Helvetica, sans-serif\"><a href=\"DataBaseNonElectronic.php\">CHECK
IT NOW </a></font></b>
</body>
</html>
im on my knees with this one.... :?