Jump to content

SELECT * FROM table WHERE column IS NOT NULL


suttercain

Recommended Posts

Hi everyone,

 

I am running the following MySQL query:

<?php
$sql = mysql_query("SELECT * FROM comics WHERE story_arc IS NOT NULL") or die (mysql_error());
while($row = mysql_fetch_assoc($sql)) {
echo $row['title'];
}
?>

 

The problem is that it is outputting all 4000+ records, when it should only be about 100. Is there an error with my 'IS NOT NULL'?

 

Thanks.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.