PHP mysql select results
- by Jordan Pagaduan
<?php
$sql = "
SELECT e.*, l.counts AS l_counts, l.date AS l_date, lo.counts AS lo_counts, lo.date AS lo_date
FROM employee e
LEFT JOIN logs l
ON l.employee_id = e.employee_id
LEFT JOIN logout lo
ON lo.employee_id = e.employee_id
WHERE e.employee_id =" .(int)$_GET['salary'];
$query = mysql_query($sql);
$rows = mysql_fetch_array($query);
while($countlog = $rows['l_counts']) {
echo $countlog;
}
echo $rows['first_name'];
echo $rows['last_name_name'];
?>
I got what I want to my first_name and last_name(get only 1 results). The l_counts I wanted to loop that thing but the result is not stop counting until my pc needs to restart. LoL. How can I get the exact result of that? I only need to get the exact results of l_counts.
Thank you
Jordan Pagaduan