Page 1 of 1

Query problem(plz help)

Posted: Mon Dec 18, 2006 9:06 am
by cty007
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Error message:

Code: Select all

Query failed: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 ')' at line 1
Can any one able to edit it in correct form?(*I using PHP5)

Code: Select all

$query="select count(*) from cart where cookieId ='GetCartId()'
and bookid = '$bookid'";

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Mon Dec 18, 2006 9:10 am
by feyd
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:3. Do not make multiple, identical posts. This is viewed as spam and will be deleted.
[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.
Ignoring our request to not use aolspeak is not a good way to get started on this board. Trying to rack up the warnings early aren't you? :|


I don't see a syntax error in your query. Logical error, maybe, but no syntax errors.

Posted: Mon Dec 18, 2006 9:16 am
by Ollie Saunders

Code: Select all

$query="select count(*) from cart where cookieId ='" . GetCartId() . "' and bookid = '$bookid'";
perhaps?