Hi friends, I am populating a drop box from a table jos_qualificati ons. can anybody tell me how to populate a drop box using classes. something like
$db->setQuery( $query );
this is my code which i have written without using classes :::::::::::::
[php]
$result = mysql_query( "SELECT category FROM jos_qualificati ons" )
or die("SELECT Error: ".mysql_error() );
// start the select list
echo '<select name="category" id="category">' ;
echo '<OPTION value="" selected>Select </OPTION>';
// read each row field and build option list
while ($row = mysql_fetch_ass oc($result))
{
$category=$row['category'];
print "<option value='$categor y'>$category</option>";
}
// close the select list
print "</select>";
?>
[/php]
//plz help me out.
$db->setQuery( $query );
this is my code which i have written without using classes :::::::::::::
[php]
$result = mysql_query( "SELECT category FROM jos_qualificati ons" )
or die("SELECT Error: ".mysql_error() );
// start the select list
echo '<select name="category" id="category">' ;
echo '<OPTION value="" selected>Select </OPTION>';
// read each row field and build option list
while ($row = mysql_fetch_ass oc($result))
{
$category=$row['category'];
print "<option value='$categor y'>$category</option>";
}
// close the select list
print "</select>";
?>
[/php]
//plz help me out.
Comment