Hi I just want to know if is it possible to have different queries with DB::getInstance() value in query at the same time on the same page? and is it good practice to do? if Not can you show me the best practice?
I have update page (update.php) on my update page I have querying the part where you would get the id in the database.
this works fine.
$id = $_GET['id'];
$agent = DB::getInstance()->get('agent', array('id', '=', $id));
Below of my update.php page is a drop down field where it will querying some part of my table data. for instance it is a director table where this user is belong.
But it does not work.
$directors = $dbh->query("SELECT * FROM directors");
echo "<select name='director' id='director'>
<option value=''>".$agent->results()[0]->agent_name."</option>";
foreach($directors->results() as $director){
echo "<option value='$director->name'>".$director->name."</option>";
}
echo "</select>";
Thank you