flemingmike Posted October 5, 2010 Share Posted October 5, 2010 hello, i have the following, which is sorting by id number with a horizontal line between. im trying to make it so that it is sorted by supplier with lines between each letter. <?phpif ($PreviousID!=0 && $ManID != $PreviousID) {?> <hr /> <?PHP } $PreviousID = $ManID; include 'config.php';include 'javascript.php';@mysql_select_db ("citycore", $conn) OR DIE (mysql_error());$sql = "SELECT * FROM supplier ORDER BY supplier";$result = @mysql_query($sql, $conn) or die(mysql_error());//$row2 = mysql_query($sql, $conn);$PreviousID=0;while ($row = mysql_fetch_array($result)) { $ManID = $row['id']; $id=$row['id']; $supplier=$row['supplier']; $address=$row['address']; $city=$row['city']; $province=$row['province']; $postal=$row['postal']; $phone2=$row['phone2']; $phone=$row['phone']; $fax=$row['fax']; $email=$row['email']; ?> <div align="center"> <table border="1" width="95%" style="border-collapse: collapse"> <tr> <td><?php echo $row['supplier'];?></td> <td><a href="http://mapof.it/<?php echo($address .' ' .$city .',' .' ' .$province .' ' .$postal); ?>" target="_blank"><?php echo($address .' ' .$city .',' .' ' .$province .' ' .$postal); ?></a></td> </tr> </table> </div><?PHP } ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.