oskare100 Posted October 30, 2006 Share Posted October 30, 2006 Hello,When I try to run this script I get the error message "You have an error in your SQL syntax near 'where payer_email = 'oskare100@test.com'' at line 1" :[code=php:0]$txn_id = "12345678910";$payer_email = "oskare100@test.com";//Connect to MySQLmysql_connect("localhost", "test", "30053005") or die(mysql_error());//Select file system databasemysql_select_db("test") or die(mysql_error());$sql13 = "INSERT INTO paypal_sales (txn_id_refund) VALUES ('$txn_id') where payer_email = '$payer_email'";$result13 = mysql_query($sql13) or die( mysql_error() );[/code]I can't figure out what SQL syntax error it's talking about..Best RegardsOskar R Quote Link to comment Share on other sites More sharing options...
alpine Posted October 30, 2006 Share Posted October 30, 2006 Assume you want to UPDATE a row:[code]$sql13 = "UPDATE paypal_sales SET (txn_id_refund) VALUES ('$txn_id') where payer_email = '$payer_email'";[/code] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.