ok have moved on quite a bit since this.
Have now got allt he display functions working, have made it so I can add branches to the database, with a selectable region box. I have even done my first array and sorted the branch names out alphabetically \o/. ( I know that is prolly easy, but man it hurt my head).
The problem I have now is on my display page which shows the branch details, I would like them also sorting in to alphabetical order.
Any ideas how I would do this?
THis is the code I have for displaying the branch details:
but that displays them in the order they were added in to the db which is no good.
How do I sort it into alphabetical order?
Have now got allt he display functions working, have made it so I can add branches to the database, with a selectable region box. I have even done my first array and sorted the branch names out alphabetically \o/. ( I know that is prolly easy, but man it hurt my head).
The problem I have now is on my display page which shows the branch details, I would like them also sorting in to alphabetical order.
Any ideas how I would do this?
THis is the code I have for displaying the branch details:
Code:
$i=0;
while ($i < $num) {
$bname=mysql_result($result,$i,"a_name");
$baddress=mysql_result($result,$i,"address");
$bpost_code=mysql_result($result,$i,"post_code");
$bfront_line=mysql_result($result,$i,"front_line");
$bback_line=mysql_result($result,$i,"back_line");
$bmobile=mysql_result($result,$i,"mobile");
$bfax=mysql_result($result,$i,"fax");
$bsite_id=mysql_result($result,$i,"site_id");
$bemail=mysql_result($result,$i,"email");
echo "<b><a name='$bname'>Site: $bname </a></b><br>Address: $baddress , $bpost_code<br>Front Line: $bfront_line<br>Back Line: $bback_line<br>Mobile: $bmobile<br>Fax: $bfax<br>Email: $bemail<br>Site ID: $bsite_id<br><hr><br>";
$i++;
}
but that displays them in the order they were added in to the db which is no good.
How do I sort it into alphabetical order?