php mysql insert query having trouble -
i have query not inserting if use clause, without clause inserts data. weird , have never seen happen before in wamp
$key=substr(md5(rand(0, 1000000)), 0, 5)
;
$key1="insert login(key_id) values('$key') (email_id = '" . mysql_real_escape_string($_post['email_id']) . "')" if(mysql_query($key1)) { $message = 'user added!.'; echo "<script> alert('$message'); location='forgotpassword.php'; </script>"; }
if echo $_post['email_id']
return valid result
insert , not mix. when inserting, creating new record. used selecting deleteing or updateing, when have specify filter rows want select, delete or update.
if want insert row, not use where. if want change row, use
$key1="update login set key_id = '$key' (email_id = '" . mysql_real_escape_string($_post['email_id']) . "')";
Comments
Post a Comment