Jump to content


Photo

Error in your SQL syntax near..


  • Please log in to reply
1 reply to this topic

#1 oskare100

oskare100
  • Members
  • PipPipPip
  • Advanced Member
  • 69 posts

Posted 30 October 2006 - 09:58 PM

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" :

$txn_id = "12345678910";
$payer_email = "oskare100@test.com";

//Connect to MySQL
mysql_connect("localhost", "test", "30053005") or die(mysql_error());

//Select file system database
mysql_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() );

I can't figure out what SQL syntax error it's talking about..

Best Regards
Oskar R

#2 alpine

alpine
  • Members
  • PipPipPip
  • Advanced Member
  • 756 posts
  • LocationNorway

Posted 30 October 2006 - 10:41 PM

Assume you want to UPDATE a row:

$sql13 = "UPDATE paypal_sales SET (txn_id_refund) VALUES ('$txn_id') where payer_email = '$payer_email'";






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users