web_master Posted July 25, 2010 Share Posted July 25, 2010 Hi, I got a problem, and I will try explain what I want on a simpliest way as I can. So, I got 3 tables. 1. Group 2. "Under" group 3. Basic text Well, the "Group" table cols is looks (simplified) like this: ID GroupName The "UnderGroup" table cols is looks (simplified) like this: ID UnderGroupName The "BasicText" table cols is looks (simplified) like this: ID Txt_Group_ID Txt_UnderGroup_ID Txt I want to reload text to look like this: I. GROUP NAME - Undergroup 1. txt 2. txt 3. txt ... II. GROUP NAME - Undergroup 1. txt 2. txt 3. txt ... Uh, I hope it is understable... Thanx in advanced T Quote Link to comment Share on other sites More sharing options...
web_master Posted July 25, 2010 Author Share Posted July 25, 2010 I try this... but its not good... // Reload from dBase $QueryReturn2 = mysql_query( 'SELECT `refgroup`.`refgroup_id`, `refgroup`.`refgroup_name_sr`, `references`.`references_group`, `references`.`references_id`, `references`.`references_txt_sr`, `refpodgroup`.`refpodgroup_id`, `refpodgroup`.`refpodgroup_name_sr`, `references`.`references_podgroup` FROM `references` Inner Join refgroup ON refgroup.refgroup_id = `references`.references_group Inner Join refpodgroup ON refpodgroup.refpodgroup_id = `references`.references_podgroup GROUP BY `references`.`references_group` ORDER BY `refgroup_id` ASC '); // Check query if(!$QueryReturn2) { echo mysql_error(); exit; } // Request query while($REQUEST = mysql_fetch_array ($QueryReturn2)) { echo 'GRUPA ' . $REQUEST['refgroup_name_sr'] . '<br />'; echo '- ' . $REQUEST['refpodgroup_name_sr'] . '<br />'; echo $REQUEST['references_txt_sr'] . '<br />'; } Its show me: I GROUP (refgroup) - Undergroup (refpodgroup) 1. Txt (references) II GROUP (refgroup) - Undergroup II (refpodgroup) 1. Txt (references) There is a more than One "references" that belong to "refpodgroup" and "refgroup" So I want to looks like this I GROUP (refgroup) - Undergroup (refpodgroup) 1. Txt (references) 2. Txt (references) 3. Txt (references) ... II GROUP (refgroup) - Undergroup II (refpodgroup) 1. Txt (references) 2. Txt (references) 3. Txt (references)... Quote Link to comment Share on other sites More sharing options...
fenway Posted July 28, 2010 Share Posted July 28, 2010 You can't use GROUP BY that way -- 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.