This is how you can use it for select.
loading a dropdown list
I will discuss the insert on next post.
<?php
include_once('classes/class.database.php');
$db = new MySQLiDB;
$args = [
'table' => 'tblcity',
'data' => [
'idCity','lbCityName'
],
'order' => 'lbCityName', // order by
'oType' => '' // ASC or DESC
];
$fetch = $db->select($args);
$res;
?>
loading a dropdown list
<select required="" id="pickup" name="pickup" class="form-control" >
<option>Please Select</option>
<?php
foreach ($fetch as $city)
{
?>
<option value='<?php echo $city['idCity'];?>'> <?php echo htmlentities(utf8_encode($city['lbCityName'])); ?></option>
<?php
}
?>
</select>
I will discuss the insert on next post.
No comments:
Post a Comment