Hi guys,
With the first $get query, I’m trying to present the user with all members from a certain age group. But inside that query I want to add all countries that specific member wants to see by using the $getCountry query.
The problem is the information echoeing out under “all countries I want to see”.
Let’s say I have Adam wanting to see USA and Ecuador. Ben wants Mexico and Tom England. The information will come out as:
-
Name:Adam
SOA: Urgent
all countries I want to see: USA, Ecuador -
Name:Ben
SOA: Urgent
all countries I want to see: USA, Ecuador, Mexico -
Name:Tom
SOA: Urgent
all countries I want to see: USA, Ecuador, Mexico, England.
Why is it doing that. I tried playing around with the while loop but nothing. All I want it to do is present each member with his countries.
$get = mysql_query("SELECT * FROM mainweb WHERE age='$age_form' AND who='civilian'");
while ($row = mysql_fetch_assoc($get))
{
$username= $row['username'];
$soa= $row['soa'];
echo"<p><span style='color: rgb(51, 102, 255);'>SOA</span>: $soa<p />";
echo"<p><span style='color: rgb(51, 102, 255);'>all countries I want to see</span>:";
$getCountry = mysql_query("SELECT country FROM mainweb WHERE username='$username' AND who='civilian'");
while ($row = mysql_fetch_array($getCountry)) {
$cwb_countires[] = $row['country'];
}
foreach ($cwb_countires as $country)
echo " $country,";
<hr size='1'><p>";
}