Baseball Posted December 26, 2009 Share Posted December 26, 2009 code: $sql2 = "SELECT f.id AS fid, f.name, f.desc, f.lpname, f.lpid,f.num_topics,f.num_replies, c.id as cid,c.position as cat_position, c.cat_name, mr.icon FROM (forum_sub_cats f, forum_cats c) LEFT JOIN users mr ON (mr.id=f.lpid) WHERE c.id=cid"; $res2 = mysql_query($sql2) or die(mysql_error()); while($row3 = mysql_fetch_assoc($res2)){ echo $row3['num_topics']; $posts = $row3['num_topics'] + $row3['num_replies']; if ($row3['cid'] != $cur_category) // A new category since last iteration? { if ($cur_category != 0) echo "\t\t\t".'</tbody>'."\n\t\t\t".'</table>'."\n\t\t".'</div>'."\n\t".'</div>'."\n".'</div>'."\n\n"; ++$cat_count; echo "<Fieldset><legend>{$row3['cat_name']} -> $posts</legend></fieldset>"; $cur_category = $row3['cid']; } echo " <a href=\".?act=forum&fid=".$row3['fid']."\">".$row3['name']."</a><br>\n"; echo " " . $row3['desc'] . "\n Posts: "; echo " </div>"; Thanks fellas. Quote Link to comment https://forums.phpfreaks.com/topic/186370-please-help-collect-join-data/ Share on other sites More sharing options...
Baseball Posted December 26, 2009 Author Share Posted December 26, 2009 Sir somone please.. I need to combine those colums for each category.. Quote Link to comment https://forums.phpfreaks.com/topic/186370-please-help-collect-join-data/#findComment-984192 Share on other sites More sharing options...
ignace Posted December 26, 2009 Share Posted December 26, 2009 You might wanna explain your problem as we are programmers not telepaths. If you want to receive help you need to help us. This means a clear explanation of the problem and properly indented code not some junk that might turn out to contain keywords of a certain programming language. The main reason you can't debug this yourself is because you can't read it anymore yourself. Quote Link to comment https://forums.phpfreaks.com/topic/186370-please-help-collect-join-data/#findComment-984211 Share on other sites More sharing options...
Baseball Posted December 26, 2009 Author Share Posted December 26, 2009 You might wanna explain your problem as we are programmers not telepaths. If you want to receive help you need to help us. This means a clear explanation of the problem and properly indented code not some junk that might turn out to contain keywords of a certain programming language. The main reason you can't debug this your self is because you can't read it anymore yourself. That's why I Ask u for help :-) Quote Link to comment https://forums.phpfreaks.com/topic/186370-please-help-collect-join-data/#findComment-984216 Share on other sites More sharing options...
BloodyMind Posted December 26, 2009 Share Posted December 26, 2009 he meant that explain what you want to do in words, I don't understand either Quote Link to comment https://forums.phpfreaks.com/topic/186370-please-help-collect-join-data/#findComment-984243 Share on other sites More sharing options...
Baseball Posted December 26, 2009 Author Share Posted December 26, 2009 he meant that explain what you want to do in words, I don't understand either Rajiv helped me, u guys dont understand me i guess, i guess only indians, lol Topic Solve.d Quote Link to comment https://forums.phpfreaks.com/topic/186370-please-help-collect-join-data/#findComment-984258 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.