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 ? Link to comment https://forums.phpfreaks.com/topic/151156-solved-row-making-2-of-everything/ 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, Link to comment https://forums.phpfreaks.com/topic/151156-solved-row-making-2-of-everything/#findComment-794078 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. Link to comment https://forums.phpfreaks.com/topic/151156-solved-row-making-2-of-everything/#findComment-794088 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.