Here’s what I’ve got:
[php]$result_ne = mysql_query(“SELECT * FROM clients WHERE market=“North East” ORDER BY market, id”);
echo “
North East
”;while ($row_ne = mysql_fetch_array($result_ne)) {
echo $row_ne[“client”] . " - " . $row_ne[“phone”] . "
";
}
$result_mw = mysql_query(“SELECT * FROM clients WHERE market=“Mid West” ORDER BY market, id”);
echo “
Mid West
”;while ($row_mw = mysql_fetch_array($result_mw)) {
echo $row_mw[“client”] . " - " . $row_mw[“phone”] . "
";
}
[/php]
In reality I really have many more ‘markets’ - but I don’t want to do a mysql_query for every one. What I want to do is have one mysql_query that gets all the data.
[php]$result = mysql_query(“SELECT * FROM clients ORDER BY market, id”);[/php]
Now - here’s my problem: How do I separate the data into arrays per market?
Please help! This has been driving me nuts!