The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
MySQL getting not empty rows
how should i go about getting not empty rows for a particular field/column? should i use foobar!='' or something else?
|
#2
|
|||
|
|||
Dependinng on the contents of the 'empty' columns (i guess you want to retrieve the content of the rows that have a value for a certain column), it would be either:
- column <> '' - column <> 0 - column IS NOT NULL |
#3
|
||||
|
||||
ok thanks
edit: the type of column is varchar, it seems to be yielding no results...but i know that some of them are empty. the sql query i am running is: [sql] "SELECT journal_id, whocanview FROM " . TABLE_PREFIX . "journals WHERE whocanview IS NOT NULL" [/sql] |
#4
|
|||
|
|||
does the column allow NULL values, if no, what is the default value.
|
#5
|
||||
|
||||
Quote:
|
#6
|
|||
|
|||
Describe the table, look in phpMyAdmin, look in the scripts that created it.
|
#7
|
||||
|
||||
under the column labeled "null" it says no for that field so i guess using IS NOT NULL will not work?
|
#8
|
|||
|
|||
Correct, the column will then contain the default value.
try with: column <> '' |
#9
|
||||
|
||||
Quote:
|
#10
|
|||
|
|||
I know.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|