The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
mysql query in php
I am trying to run a query with a couple of conditions, unfortunately they are giving me grief.
What I am after is the following: if text has a title then skip and continue onto the next if text has a null title, then get that information if status=allowed status, text and title are all text fields, this is what I have so far PHP Code:
|
#2
|
|||
|
|||
If you are trying to fetch rows where the title is NULL and the status is "allowed", then your WHERE clause would look like this:
[SQL]SELECT username,title,text,date,userid,status FROM table_text WHERE title IS NULL AND status = 'allowed' ORDER BY date desc LIMIT 5[/SQL] |
#3
|
|||
|
|||
ok thats helped, but I've now seen my mistake. I am taking a blank field as being NULL, but of course its isnt.
How would I change WHERE title IS NULL to WHERE title IS Blank |
#4
|
|||
|
|||
[SQL]WHERE title = ''[/SQL]
|
#5
|
|||
|
|||
thanks
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|