Treat the data as if you were putting it in an HTML table. For instance here I take the id of each member in the regionalstaff table and put it into an excel spreadsheet I call "blah.xls". Notice that I construct a HTML style table and put each item in a <td> tag. What this will do is treat each cell of the table as each cell of the spreadsheet.
CODE
$result = mysql_query("Select * from regionalstaff",$link);
$header = "<table border='0' cellpadding='0' cellspacing='0'>";
while ($row = mysql_fetch_array($result)) {
$header .= "<tr><td>". $row["id"] . "</td></tr>";
}
$header .= "</table>";
header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: inline; filename=blah.xls");
echo $header;
So after this is run all the ids will be in column A of my spreadsheet and it will act more like the normal excel you have grown to love. Each value will be in each cell of the spreadsheet.
Hope this is what you were asking about.
Enjoy!
"At DIC we be spreadsheet generating code ninjas... some of the ladies man style ninjas all split the sheets with the ladies"