Hi guys,
I have a database with users on it. Every user has a number of rows according to the amount of countries he wants to visit. All the information is the same except for county colunm.
So what I’m trying to do, and not succeeding, is to dispaly all the information of each user and the additional countries they’d like to see. But I’m having trouble grouping all the countries they’d like to see according to each user (member_id).
Any help appreciated.
Thank you.
SELECT mainweb.*
, GROUP_CONCAT(mainweb.country) AS country //(here is where I try to group additional countries each user woud like to see)
FROM mainweb
WHERE mainweb.country = '$country_form'
GROUP
BY mainweb.member_id
ORDER BY date DESC
LIMIT $start, $per_page
while ($row = mysql_fetch_assoc($get))
{
$lastname= $row['lastname'];
$firstname= $row['firstname'];
$country= $row['country'];
echo $firstname $lastname;//and other info user has
//here I try to explode the string of countries I grouped according to member_id.
$countries = explode(",",$country);
foreach($countries as $c)
echo "additional countries they'd like to see: .$c";
}