Jump to content

[SOLVED] INSERT problem with WHERE


cs1h

Recommended Posts

Hi,

 

I am trying to insert data into a specific row in a database.

 

My code is,

mysql_query($sql = "insert into `$table` (`$photoPlace`) values ('$finalName') WHERE `code1` = '$code1' AND `code2` = '$code2'") or die(mysql_error()); 

 

The error is,

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 `code1` = 'xxx' AND `code2` = 'yyy'' at line 1

 

I'm sure this is a simple thing to solve but I can not work it out.

 

All help is very much appreciated,

Cs1h

Link to comment
https://forums.phpfreaks.com/topic/143743-solved-insert-problem-with-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.