I have a row and I want to get the fields that arent null into an array. How would I do that?
fetch the row into an array $row
foreach($row as $key=>$value) { if(!is_null($value)) { $realrow[$key]=$value; } } $row=$realrow;
Henry
I am assuming by looking for fileds that are not null then you are looking for fields that are not empty?
If so then
Another way would be to use !empty in place of the !is_null that hayley suggested
gary mailer
Thanks alot for your help.