TimUSA Posted December 31, 2007 Share Posted December 31, 2007 Sorry for all my posts, but I need help again! I am a rookie! I now have a table that looks like this: raceID memberName raceDate factor racePoints matchPoints fleetPoints 1 Arione 2007-12-29 2 0.75 NULL 1.50 2 Biscia 2007-12-29 2 2.00 NULL 4.00 3 artwales 2007-12-29 2 0.00 NULL 0.00 4 Arione 2007-12-29 2 0.75 NULL 1.50 5 Biscia 2007-12-29 2 2.00 NULL 4.00 6 artwales 2007-12-29 2 0.00 NULL 0.00 i would like to do something like this: $nameresult = mysql_query("SELECT `memberName` from `ladder_points` where `membername` = [???where each are the same???] order by `memberName`; any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/83786-solved-sorry-for-all-my-posts-but-i-need-help-again/ Share on other sites More sharing options...
Dane Posted December 31, 2007 Share Posted December 31, 2007 $nameresult = mysql_query("SELECT `memberName` from `ladder_points` where `raceid` > 0 order by `memberName`; if you're trying to echo them all out of the table. Quote Link to comment https://forums.phpfreaks.com/topic/83786-solved-sorry-for-all-my-posts-but-i-need-help-again/#findComment-426308 Share on other sites More sharing options...
papaface Posted December 31, 2007 Share Posted December 31, 2007 He is trying to group them. I know you can GROUP BY once, not sure about grouping multiple things though. Quote Link to comment https://forums.phpfreaks.com/topic/83786-solved-sorry-for-all-my-posts-but-i-need-help-again/#findComment-426313 Share on other sites More sharing options...
TimUSA Posted December 31, 2007 Author Share Posted December 31, 2007 He is trying to group them. yep! that may work so am i on the right path here? $nameresult = mysql_query("SELECT `memberName` from `ladder_points` group by `membername` order by `memberName`; $result=mysql_query($nameresult); $num=mysql_numrows($result); $i=0; while ($i < $num) { echo $row[0]; //not sure if this is correct $i++; } Quote Link to comment https://forums.phpfreaks.com/topic/83786-solved-sorry-for-all-my-posts-but-i-need-help-again/#findComment-426317 Share on other sites More sharing options...
TimUSA Posted December 31, 2007 Author Share Posted December 31, 2007 ok working sort of: $sql = "SELECT `memberName` , `fleetPoints` from `ladder_points` group by `membername` order by `memberName`;"; $result = mysql_query($sql); $num = mysql_numrows($result); $i = 0; $name = mysql_result($result,$i,"memberName"); $fleetpoints = mysql_result($result,$i,"fleetPoints"); while ($i < $num) { echo "<b>$name $fleetpoints</b>"; $i++; } returns this: alvaritop 16.00alvaritop 16.00alvaritop 16.00alvaritop 16.00 rather than individual results Quote Link to comment https://forums.phpfreaks.com/topic/83786-solved-sorry-for-all-my-posts-but-i-need-help-again/#findComment-426349 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.