Question: I'm trying to filter a mySQL database table into a web page. I am okay when it comes to getting specific data from a column using the query:

```
$result = mysql_query("SELECT * FROM availability WHERE location = 'London'");

```

But what I am having particular trouble with is retrieving results from a column where there are some variable values as well as some NULL values. I just can't get it to work. What I want to do is select the table, identify a column and then display all results from that specific column where there is a value i.e. not null. At present I have tried things like:

```
$result = mysql_query("SELECT * FROM availability WHERE team IS NOT NULL")

$result = mysql_query("SELECT team FROM availability WHERE team IS NOT NULL");

```

What am I doing wrong? I'm not an expert with PHP and have researched and tried various solutions but I keep getting a server error. Any advice gratefully received.

Answer: 
You forgot a semicolon between the first and the second row:

```
$result = mysql_query("SELECT * FROM availability WHERE team IS NOT NULL");
$result = mysql_query("SELECT team FROM availability WHERE team IS NOT NULL");

```

And I guess you don't want to name both variables as `$result`.

PS: You should use MySQLi or PDO instead of `mysql_*` functions, which are deprecated. [More information avalible here](http://cz2.php.net/manual/en/mysqlinfo.api.choosing.php).
You did the right sql.
The right sql should be:

```
$result = mysql_query(" SELECT `team` FROM `availability` WHERE `team` IS NOT NULL");

```

then only show the value those are not null. You just check you are using the right field in where condition..