Will empty or NULL values from database be returned ?
Posted: Sun May 24, 2009 5:19 pm
Well, this is a newbie question that I can't find the answer.
If you have empty values or NULL value in your database, will it get return ?
here is a simple database:
id name
1 bob
2
3 NULL
4 chris
here is my simple code:
$query = mysql_query("SELECT * FROM table ORDER BY id ASC", $connection);
while ($array = mysql_fetch_array($query)) {
$name = $array['name'];
}
Now the question is what is inside the $name array ?
Will it be array([0]=>bob [1]=> [2]=> [4]=>chris) ?
or will it be array([0]=>bob [1]=>chris) ?
Thank you all in advance !
If you have empty values or NULL value in your database, will it get return ?
here is a simple database:
id name
1 bob
2
3 NULL
4 chris
here is my simple code:
$query = mysql_query("SELECT * FROM table ORDER BY id ASC", $connection);
while ($array = mysql_fetch_array($query)) {
$name = $array['name'];
}
Now the question is what is inside the $name array ?
Will it be array([0]=>bob [1]=> [2]=> [4]=>chris) ?
or will it be array([0]=>bob [1]=>chris) ?
Thank you all in advance !