denoteone Posted April 24, 2009 Share Posted April 24, 2009 Can anyone help me with the syntz to insert a value into a filed WHERE another field = $email? So far I have $insert = "INSERT INTO users (password_key) VALUES ('$passwordKey') WHERE `email` = '$email'"; $add_member = mysql_query($insert); Quote Link to comment https://forums.phpfreaks.com/topic/155525-solved-insert-where/ Share on other sites More sharing options...
Maq Posted April 24, 2009 Share Posted April 24, 2009 Why are you using INSERT? That is for creating a new record... Do you mean UPDATE? Quote Link to comment https://forums.phpfreaks.com/topic/155525-solved-insert-where/#findComment-818410 Share on other sites More sharing options...
denoteone Posted April 24, 2009 Author Share Posted April 24, 2009 There is nothing in the password_key field yet. But I guess if they have to change their password again there will be something in that field. Can I use update even if the field is empty the first time? Quote Link to comment https://forums.phpfreaks.com/topic/155525-solved-insert-where/#findComment-818416 Share on other sites More sharing options...
premiso Posted April 24, 2009 Share Posted April 24, 2009 There is nothing in the password_key field yet. But I guess if they have to change their password again there will be something in that field. Can I use update even if the field is empty the first time? Yes, you can use UPDATE as long as the full record is there. (Even if some fields were not filled in the first time around). Quote Link to comment https://forums.phpfreaks.com/topic/155525-solved-insert-where/#findComment-818419 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.