SQL syntax or somethin..

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bla5e
Forum Contributor
Posts: 234
Joined: Tue May 25, 2004 4:28 pm

SQL syntax or somethin..

Post by bla5e »

Code: Select all

$sql = pg_query($db,"UPDATE history SET action='{$from}' WHERE action='{$to}' AND author='{$uid}' AND ideaid={$_POST['idea']}");
ERROR: syntax error at end of input at character 100
Ive been looking and maybe its jsut been a long day, but i cant find it?
action/author = text
ideaid = #
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: SQL syntax or somethin..

Post by Christopher »

If you do this, what is the actual SQL statement being executed?

Code: Select all

$sql = "UPDATE history SET action='{$from}' WHERE action='{$to}' AND author='{$uid}' AND ideaid={$_POST['idea']}";
echo "sql=$sql<br/>";
$result = pg_query($db, $sql);
(#10850)
bla5e
Forum Contributor
Posts: 234
Joined: Tue May 25, 2004 4:28 pm

Re: SQL syntax or somethin..

Post by bla5e »

Christopher wrote:If you do this, what is the actual SQL statement being executed?

Code: Select all

$sql = "UPDATE history SET action='{$from}' WHERE action='{$to}' AND author='{$uid}' AND ideaid={$_POST['idea']}";
echo "sql=$sql<br/>";
$result = pg_query($db, $sql);
thanks, passing the wrong variable :banghead:
Post Reply