jamesxg1 Posted March 26, 2009 Share Posted March 26, 2009 if($_SESSION['groupid'] == 'A') { $count = 0; $query = mysql_query("SELECT * FROM menu ORDER BY position ASC") or die(mysql_error()); while ($menu = mysql_fetch_object($query)) { if ($count!=0){echo " ";} echo "<tr><td style=\"padding-left:40\"><font style=\"font-size:7\">></font><a href=\"$menu->link\" alt=\"$menu->name\" class=\"menu\">".$menu->name."</a></td></tr><tr><td><img src=\"images/midl.jpg\" border=\"0\" width=\"197\" height=\"8\" alt=\"\"></td></tr> <tr><td style=\"padding-left:40\"><font style=\"font-size:7\">></font><a href=\"Logout.php\" alt=\"Logout\" class=\"menu\">Logout</a></td></tr><tr><td><img src=\"images/midl.jpg\" border=\"0\" width=\"197\" height=\"8\" alt=\"\"></td></tr>"; $count++; } } its creating double of everything :S ? Quote Link to comment Share on other sites More sharing options...
bluejay002 Posted March 26, 2009 Share Posted March 26, 2009 Are you trying to say that the query itself is repeating some entries? If so, try adding DISTINCT right after select. Jay, Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted March 26, 2009 Share Posted March 26, 2009 That would indicate you have duplicate data in your table and you should probably examine the data directly to check and delete the duplicates. 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.