<<I need it to echo out a table with all the A's first, then a blank line,
then all the B's, a blank line and so on. I could write 26 different
queries, one for each letter of the alphabet, but surely there is a tidier
way.>>
Do a query, sorting by the field you need alphabetized. Then do this (and
tidy it up as you need):
echo "<table>";
while($result = mysql_fetch_row$(query)) {
if(substr($result, 0, 1) != $previousfirstletter) {
$previousfirstletter = substr($result, 0, 1);
echo "<tr><th>$previousfirstletter</th></tr>";
}
echo "<tr><td>$result</td></tr>";
}
echo "</table>";
It's untested, but I believe it will work.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php