Page 1 of 1

dbpQuery limitation

PostPosted: Wed Jul 16, 2014 4:05 pm
by stu
Im trying to execute the following query to the db but its not working, I figure my SQL sintax its not possible since it includes AND twice... Is there any way of doing this through another method?

Syntax: [ Download ] [ Hide ]
Using Neobook Syntax Highlighting
dbpQuery "DBID" "orderdetail" "ORDERRENTEDBY LIKE [#34][DBID.USERS.USERNAME][#34] AND FEE = 1 AND ORDERDATERETURNED IS NULL"
Parsed in 0.006 seconds, using GeSHi 1.0.8.10


Thanks.

----

Sorry about this, I found my answer on a similar question over Stackoverflow...

Syntax: [ Download ] [ Hide ]
Using SQL Syntax Highlighting
SELECT *
FROM  `orderdetail`
WHERE  `ORDERRENTEDBY` LIKE  "[#34][DBID.USERS.USERNAME][#34]"
AND  `ORDERDATERETURNED` IS NULL
AND  `FEE` =1
Parsed in 0.005 seconds, using GeSHi 1.0.8.10

Re: dbpQuery limitation

PostPosted: Wed Jul 16, 2014 4:32 pm
by Gaev
stu:

Try and place the conditions within brackets like this ...
Code: Select all
dbpQuery "DBID" "orderdetail" "(ORDERRENTEDBY LIKE [#34][DBID.USERS.USERNAME][#34]) AND (FEE = 1) AND (ORDERDATERETURNED IS NULL)"


It is not clear what you mean when you say "but its not working" ... you might want to provide details of what the value of [DBID.USERS.USERNAME] is ... and what the expected/actual results are.

Re: dbpQuery limitation

PostPosted: Wed Jul 16, 2014 4:35 pm
by stu
Thanks for your reply, yeah I just used dbpexecsql instead, I wil try your suggestion it was probably a missing char or something. Thanks again.