![]() |
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:
|
you're doing the query before you set the conditional. At least it looks that way at first glance.
|
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:
|
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"). |
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! :D Thanks, Alan. |
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? |
All times are GMT. The time now is 07:07 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|