-1

I can not find out why this is not working..... i keep getting this message

Query failed: 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 ''laketaho_benny'.'tblPictures' SET 'caption' = 'uuuuuuuuuupppp' WHERE 'tblPic' at line 1

and this is my code

$sql = "UPDATE  `laketaho_benny`.`tblPictures` SET  `caption` =  `$caption` WHERE  `tblPictures`.`pictureID` =$pictureID;";
user67651
  • 1
  • 1

1 Answers1

0

Single quotes are for strings. You're thinking of backquotes ( ` ).

Rickkwa
  • 2,197
  • 4
  • 23
  • 34
  • like this $sql = "UPDATE `laketaho_benny`.`tblPictures` SET `caption` = `$caption` WHERE `tblPictures`.`pictureID` =$pictureID;"; – user67651 Jun 23 '14 at 18:52
  • Use the backquotes on column or table names. So you don't need them on `$caption` and `$pictureID`. Also, whats the type of `caption` and `pictureID`? – Rickkwa Jun 23 '14 at 19:14