Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

if else

Status
Not open for further replies.

JJJ777

Programmer
Jun 5, 2002
33
MY
hi all;

how can i change the query so that the result will only display the array with value only..?


$query2 = "SELECT * FROM lkp_country";
$result2 = pg_exec($query2);
$total2 = pg_numrows($result2);
while ($row = pg_fetch_array($result2)) {
$arrsu[] = $row["ctry_code"];
$arrsu2[] = $row["ctry_desc"];
}

$strData = '$data=array(';
for($i=0; $i<$total2; $i++) {

$query = &quot;SELECT * FROM adm_student_registered
INNER JOIN adm_student_profile ON adm_student_registered.sreg_stud_profileid = adm_student_profile.stud_profileid
WHERE stud_country = '$arrsu[$i]' &quot;;
$result = pg_exec($query);
$total = pg_numrows($result);
$rows = pg_fetch_array($result);

$strData .= &quot;\&quot;&quot; . &quot; $arrsu2[$i]&quot; . &quot;\&quot;&quot; . ' => ' . $total . ',';
}
$strData .= ');';
eval($strData);


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top