....is dis my code is correct???...help me plz.....

A

Anonymous

Guest
Code:
<?php
include ('DBObject.cls.php');
$db = new DbObject();
$id = $_GET['id'];
$db = new DbObject();//<--you already did this two lines before
$query ="Select * from tb_brgy Group by brgy_name order by brgy_name asc";
$db->query("$query");
$numrows = $db->GetNumRows();
for ($x = 1; $x<=$numrows; $x++)
{
$db->nextrecord();
$category.="<option value=\"".$db->GetField('brgy_id')."\">".$db->GetField('brgy_name')."</option>"; <this line have error....>//Yes. Thats wrong
}
$db->Close();
?>

Code:
<?php
include ('DBObject.cls.php');
$db = new DbObject();
$id = $_GET['id'];
$query ="Select * from tb_brgy Group by brgy_name order by brgy_name asc";
$db->query("$query");
$numrows = $db->GetNumRows();
for ($x = 0; $x<=$numrows; $x++)
{
$db->nextrecord();
$category.="<option value=".$db->GetField('brgy_id').">".$db->GetField('brgy_name')."</option>"; //<- if this still views an error, show you're class. Depends on what happends by calling GetField
}
$db->Close();
?>
 
Back
Top