soycharliente Posted June 29, 2007 Share Posted June 29, 2007 Am I not seeing some spelling error or is there something fundamentally wrong with this code? while ($r = mysql_fetch_array($result)) { $id = $r["id"]; if ($id % 2) { echo "<tr>\n"; } else { echo "<tr class=\"colored\">\n"; } } Every case takes the else route. WHYYYYYYYYYYY? AHHHHHHHHHHHHHHHH/ Link to comment https://forums.phpfreaks.com/topic/57667-solved-modulus/ Share on other sites More sharing options...
soycharliente Posted June 29, 2007 Author Share Posted June 29, 2007 OMGWTFBBQ ROFL! And the problem is? *DRUM ROLL* Query I was using: SELECT loc AS place, COUNT(loc) AS tally FROM data GROUP BY loc Do you see me selecting the id field? I don't. LOL Works now that I'm actually selecting it. Link to comment https://forums.phpfreaks.com/topic/57667-solved-modulus/#findComment-285551 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.