![]() |
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:
|
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] |
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 |
[SQL]WHERE title = ''[/SQL]
|
thanks
|
All times are GMT. The time now is 09:33 PM. |
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:
|