Hi,
I am trying arrange records, which contain the first letters of a group of companies, from my database in columns, and this is my SQL query:
This is my PHP code for arranging the records:Code:mysql_select_db($database_directory, $directory); $query_mda = "SELECT DISTINCT mdal FROM mda ORDER BY mdal ASC"; $mda = mysql_query($query_mda, $directory) or die(mysql_error()); $row_mda = mysql_fetch_assoc($mda); $totalRows_mda = mysql_num_rows($mda);
The problem I am encountering is that it displays all the records except the first record. Please what am I doing wrong?Code:<?php $cols = 10; $count = 0; echo("<table align=\"center\"><tr>"); while($row_mda = mysql_fetch_array($mda)) { if($count % $cols == 0) echo("</tr><tr>"); echo ("<td align=\"center\">"." "." "." "." "." "." "."<a href=\"list.php?mdal=".$row_mda['mdal']."\" class=\"listTextA\">".$row_mda['mdal']."</a>"." "." "." "." "." "." "); echo("</td>"); $count++; } echo("</tr></table>"); ?>


Reply With Quote


Bookmarks