Jump to content

Recommended Posts

Hey everyone,  I'm getting this error message:

 

"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE email = 'ataylor'' at line 1"

 

On this code:

 

"

mysql_query("INSERT INTO `staff` (email,pword) VALUES ('$email','$pword') WHERE email = 'ataylor'") or die (mysql_error());

 

I'm having a hard time figuring out what is wrong.  Any help is appreciated.

Link to comment
https://forums.phpfreaks.com/topic/244956-need-another-set-of-eyes/
Share on other sites

OK, different query, different problems...

 

When I use this:

 

mysql_query("UPDATE `staff` SET `email` = '$email',`pword` = '$pword' WHERE staffid = '$staffid'") or die (mysql_error());

 

Only the pword field is updated...

 

This:

 

mysql_query("UPDATE `staff` SET `email` = '$email' WHERE staffid = '$staffid'") or die (mysql_error());

mysql_query("UPDATE `staff` SET `pword` = '$pword' WHERE staffid = '$staffid'") or die (mysql_error());

 

Only updates the email  field...

 

And this:

 

mysql_query("UPDATE `staff` SET `pword` = '$pword' WHERE staffid = '$staffid'") or die (mysql_error());

 

Does absolutely nothing...

 

I'm getting no errors at all.  Any ideas?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.