I\'ve got a database which contains lots of data. I would like to select all data, but Group by one column.
So for example:
column a | column b
examp
The example live of accordion: http://jsfiddle.net/WMUJ3/207/ Just implement in code below. ;)
The code to mount data:
Your page
{$row->column_a}";
//This get the values with column a some value
$sql2 = "SELECT column_b FROM table WHERE column_a LIKE '%{$row->column_a}%'";
$result2 = mysql_query($sql2) or die(mysql_error());
$html .= '';
while ($row2 = mysql_fetch_object($result2)) {
$html .= '- {$row2->column_b}
';
}
$html .= '
';
}
return $html;
}
?>