MySQL UPDATE error to line 2 -


i have script:

include ('connect.php'); $data = mysql_query("select * projects id='2'") ; $da = mysql_fetch_array($data); if(isset($_post['submit'])){     $name = $_post['project_name'];     $date = $_post['date'];     $amount = $_post['amount'];     $curr = $_post['curr'];     $spec = $_post['spec'];      $sql = "update projects             set (name='$name', date='$date', amount='$amount', currency='$curr', specifications='$spec')             id=2";     $res = mysql_query($sql);  if($res)         {             echo "upadate successfull!";         }         else         {             echo "sorry!";             echo mysql_error($connect)."<br />"; echo error_reporting(e_all)."<br />"; echo ini_set('desplay_errors','1');         } 

note: connect.php file working ok since i've used before on other scripts on same server.

every time try submit form: sorry!you have error in sql syntax; check manual corresponds mysql server version right syntax use near '(name='sdadas', date='08/21/2013', amount='2444', currency='dollars', specificat' @ line 2 32767

what problem?

update .. set syntax not use parenthesis:

update projects     set name='myproject', date='08/21/2013', amount='2444', currency='dollars', specifications='none'    id=2 

Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -