Jump to content

[SOLVED] Syntax question AND WHERE?


YourNameHere

Recommended Posts

I need to select a row and update it.

 

I need to select a column against 2 columns, cname and owner.

 

$skillsInsert = "UPDATE `dd`.`chars` SET `skillPoints` = '4' WHERE `chars`.`Owner` = `Cody` AND WHERE `chars`.`cname` = `Silk` LIMIT 1 ;";
$result = mysql_query($skillsInsert);

 

I got $skillsInsert from phpMyAdmin and added the AND WHERE clause to it.

 

This is what I get when I echo the error

 

Could not connect: 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 cname = `Silk` LIMIT 1' at line 1
Link to comment
https://forums.phpfreaks.com/topic/176357-solved-syntax-question-and-where/
Share on other sites

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.