Welcome Guest, Not a member yet? Register   Sign In
how to create queries like this...
#4

[eluser]tusukgigi[/eluser]
this is my view


if(count($getCountry)){
foreach($getCountry as $key=>$list){
echo $list['district_name']."<br />";
echo $list['city_name']."<br />";
}
}

$getCountry is a variable from controller

this is my model database
SELECT DISTINCT city_name, district_name FROM district LEFT JOIN city ON city.district_id = district.id

and this is the result

country1
jakarta
country1
bandung

country2
newyork

....

there is a COUNTRY repeat's


Messages In This Thread
how to create queries like this... - by El Forum - 07-29-2010, 02:53 AM
how to create queries like this... - by El Forum - 07-29-2010, 02:57 AM
how to create queries like this... - by El Forum - 07-29-2010, 03:01 AM
how to create queries like this... - by El Forum - 07-29-2010, 03:28 AM
how to create queries like this... - by El Forum - 07-29-2010, 03:29 AM
how to create queries like this... - by El Forum - 07-29-2010, 03:36 AM
how to create queries like this... - by El Forum - 07-29-2010, 03:44 AM
how to create queries like this... - by El Forum - 07-29-2010, 03:47 AM
how to create queries like this... - by El Forum - 07-29-2010, 03:53 AM
how to create queries like this... - by El Forum - 07-29-2010, 04:05 AM
how to create queries like this... - by El Forum - 07-29-2010, 04:08 AM
how to create queries like this... - by El Forum - 07-29-2010, 04:11 AM
how to create queries like this... - by El Forum - 07-29-2010, 04:22 AM
how to create queries like this... - by El Forum - 07-29-2010, 04:24 AM
how to create queries like this... - by El Forum - 07-29-2010, 04:26 AM
how to create queries like this... - by El Forum - 07-29-2010, 04:30 AM
how to create queries like this... - by El Forum - 07-29-2010, 04:33 AM
how to create queries like this... - by El Forum - 07-29-2010, 04:48 AM



Theme © iAndrew 2016 - Forum software by © MyBB