0

hi i am having trouble in updating my selected id, i know here's is the problem

$insert_announcement = mysql_query("UPDATE `loanapplicationform`.`announcement` SET `announce_name` = '$title' WHERE `announcement`.`id` =`$id;`");

i think its in where, because if I changeit it to

$insert_announcement = mysql_query("UPDATE `loanapplicationform`.`announcement` SET `announce_name` = '$title' WHERE `announcement`.`id` =2"); 
it works but i need the logic like //if selected id = id;

please help me

  • `id` =`$id;` you are using semicolon inside `` quotes and remove these quotes from id it should be '' – Junaid Ahmed May 18 '15 at 11:57
  • it doesn't work mate – Juan Nakpil May 18 '15 at 11:59
  • "UPDATE `loanapplicationform`.`announcement` SET `announce_name` = '$title' WHERE `announcement`.`id` ='$id' "; – Junaid Ahmed May 18 '15 at 12:03
  • still don't work mate – Juan Nakpil May 18 '15 at 12:13
  • Please, [stop using `mysql_*` functions](http://stackoverflow.com/questions/12859942/why-shouldnt-i-use-mysql-functions-in-php). They are no longer maintained and are [officially deprecated](https://wiki.php.net/rfc/mysql_deprecation). Learn about [prepared statements](http://en.wikipedia.org/wiki/Prepared_statement) instead, and consider using PDO, [it's not as hard as you think](http://jayblanchard.net/demystifying_php_pdo.html). – Jay Blanchard May 18 '15 at 12:36

0 Answers0