tags:

views:

18

answers:

1
$sql = "SELECT * FROM table";
$result = mysql_query($sql);


while($row = mysql_fetch_row($result)){
   // PRINT COLUMN NAMES WITH EMPTY VALUE
}

how can i do this?
thanks

+2  A: 
$sql = "SELECT * FROM table";
$result = mysql_query($sql);

while($row = mysql_fetch_assoc($result))
{
    foreach ($row as $columnName => $value)
    {
        if (empty($value))
        {
            echo $columnName;
        }
    }
}
madsleejensen