Hi guys,
Thanks for the support you offer us less learned people. I have this php query below that attaches the database columns into an array.
=> $database sends & fetches the query to a function that connects to the mysql db.
$pets_query = “SELECT p_id, name, account_number, type, breed, owner, time_in, doctor, time_seen, time_out FROM pet_cash WHERE p_id = ‘{$id_capture}’ ORDER BY time_in DESC”;
$petss = $database->database_query($pets_query);
while($pets_info = $database->database_fetch_assoc($petss))
{
//$pets;
$pets->pets_info[p_id] = $pets_info[p_id];
$pets->pets_info[name] = $pets_info[name];
$pets->pets_info[account_number] = $pets_info[account_number];
$pets->pets_info[type] = $pets_info[type];
$pets->pets_info[breed] = $pets_info[breed];
$pets->pets_info[owner] = $pets_info[owner];
$pets->pets_info[time_in] = $pets_info[time_in];
$pets->pets_info[doctor] = $pets_info[doctor];
$pets->pets_info[time_seen] = $pets_info[time_seen];
$pets->pets_info[time_out] = $pets_info[time_out];
$pets_array[] = $pets_info;
}
I have tried numerously but i have failed. I want to print the “doctor” values only. i was advised to look into for-each loops but all the ones i have tried have failed. below is a sample of the output data from the ‘$pets_array’ array.
Array ( [0] => Array ( [p_id] => 11 [name] => kiki [account_number] => 75edfs [type] => bird [breed] => parrot [owner] => 456 [time_in] => 14156427101201 [doctor] =>12 [time_seen] => 14156427105210 [time_out] => 0 ))
How do i only select doctors from this array?
Thanks alot.