Page 1 of 1

You have an error in your SQL syntax; check..

Posted: Sat Nov 18, 2006 11:17 am
by oskare100
Hello,
When I run this part of the script

Code: Select all

mysql_query("INSERT INTO paypal_sales (viewed_online, viewed_online_by_ip) VALUES('$datenow', '$ip') where $txn_id = $txn_id ") 
or die(mysql_error());
I get the error

Code: Select all

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 'where 0UU67926P08484626 = 0UU67926P08484626' at line 1
If I remove it the script works fine again.. What do you think can be the problem?

Best Regards
Oskar R

Posted: Sat Nov 18, 2006 12:15 pm
by feyd
INSERT syntax does not include a WHERE clause.
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:1. Select the correct board for your query. Take some time to read the guidelines in the sticky topic.