![]() |
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?
|
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 |
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] |
does the column allow NULL values, if no, what is the default value.
|
Quote:
|
Describe the table, look in phpMyAdmin, look in the scripts that created it.
|
under the column labeled "null" it says no for that field so i guess using IS NOT NULL will not work?
|
Correct, the column will then contain the default value.
try with: column <> '' |
Quote:
|
I know. ;):D:D:D
|
All times are GMT. The time now is 07:24 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:
|