Jump to content

Need another set of eyes.


elmas156

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?

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.