The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
conditional query
can i do?
PHP Code:
|
#2
|
||||
|
||||
i think you forgot a { } pair
PHP Code:
|
#3
|
||||
|
||||
but if i put them additionals curly brackets in, won't i close the conditionals? before it's acheive what i want it to?
|
#4
|
||||
|
||||
heres an example of the code i'm trying to ask if will work or not
PHP Code:
|
#5
|
||||
|
||||
if you don't close the brackets, the else will be regarded to the inner if's and not to the outer if as you want to have
|
#6
|
||||
|
||||
ok sorry to bother you but i don't get it, just edited my last post for a clarity, basically the conditional starts inside of the if/else and ends outside of it. yet if i close them, then it's not gonna perform what i'm asking it to do?
|
#7
|
||||
|
||||
now you have confused me.....
i don't get what you want, but from what you said before, that code is correct: PHP Code:
|
#8
|
||||
|
||||
I've clarified your code.
It's extremely recommended to put brackets for if, else, loops, and functions under the statement. Also, when verifying if a variable exists, use isset(). If you just want to see if a variable has a value, check with the ! (bang) operator in a boolean statement. For strings, use empty(). Here is your code. I'm not sure what you're trying to achieve with the empty IFs, but you were missing the last bracket. PHP Code:
|
#9
|
||||
|
||||
thank you all, it's very much appreciated, velo, what i was trying to acheive started with the $flood variable and ended with the "INSERT INTO confessions SET..." bit basically i was trying to find out if i needed to repeat the whole code or if i could just use the conditional based on an admin cp option of letting guests confess or not.
|
#10
|
||||
|
||||
Just a minor correction..
I had: PHP Code:
Not using ! is equivalent to !empty(), or just placing a variable between the () in a statement. The code should have been: PHP Code:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|