yes, i was trying to copy and paste real quick before i had to run out,
what i ment was i had the querys in for the counts, the option table is pretty static
SELECT DISTINCT type, COUNT(type) AS count FROM options WHERE category=‘automobile’ AND subcategory=‘car’ group by type order by type
will give me:
audio 11
body 4
comfort 10
engine_cyl 6
engine_ltr 13
extras 22
fuel_type 6
int_style 4
standard 3
status 3
title 3
trans 3
trans_drive 3
trans_type 4
warranty 3
audio for example then
if( $rows[type] == “audio” ) {
if( strpos(" ".$result2[Audio] , $rows[veh_option]) > 0 ) {
$audio = $audio."<input type='checkbox' name='audio' value='$rows[veh_option]'CHECKED id='$rows[recID]' >$rows[veh_option] <br>";
} else {
$audio = $audio."<input type='checkbox' name='audio' value='$rows[veh_option]' id='$rows[recID]' >$rows[veh_option] <br>";
}
$aud++;
if($aud == 3){
$audio = $audio."</td><td valign='top'>";
$aud=0;
}
}
knowing I have 11 audio options i can / by 3 and get a nicely formated 4 column check box list.
dealers wanted to start adding to the options, so i made the options_extra , they all just add the type in as “additional” which was easy to just have that as a seperate checkbox list, and num_rows was my count,
$count=mysql_num_rows($result1);
$divid = round($count / 4);
so when a specific dealer added 60 “additional” options i still had a nicely formated 4 column checkbox list,
now they wanted to start seperating these into there approperate “type”
is when i started trying to join the tables, by changing a few of the “additional” to “audio” resetting the aud counter at 3 produced more columns,
i think im just overcomplicating this in my head. but the objective is to just keep everything aligned to 4 colums
i wasnt sure if there was a way to run Distinct on the tables after the union, rather then seperatly on both adding them together to get a “count” that i can divide by 4
and use that as my
if($addition == $divid){
$additional = $additional."</td><td valign='top'>";
$addition=0;
}