The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
how do i add a conditional to a query?
Trying to add a conditional to the following query, but can't quite get it to work... any ideas what i am doing wrong?
PHP Code:
|
#2
|
||||
|
||||
you're doing the query before you set the conditional. At least it looks that way at first glance.
|
#3
|
||||
|
||||
thanks Amy, i still can't figure it out though - until i can, this should be a work around, however i know it should be able to make it happen- just neeed to work on it......
PHP Code:
|
#4
|
||||
|
||||
Build the query as a variable (like $sql) first, and then run it afterwards.
(BTW, there is nothing wrong with doing it the way you have in your "workaround"). |
#5
|
|||
|
|||
Try:
PHP Code:
Also, you shouldn't use $_GET[] directly within the query, clean it using the input_cleaner class first Oh, and don't forget table prefixes! Thanks, Alan. |
#6
|
||||
|
||||
lol, the AND shoudl have been a WHERE (oops)
PHP Code:
Paul, i am going to try to do what you said, but I am a little confused, didn't i already build the query as the variable $querycontents? |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|