PHP mysql select results

Posted by Jordan Pagaduan on Stack Overflow See other posts from Stack Overflow or by Jordan Pagaduan
Published on 2010-06-03T00:24:52Z Indexed on 2010/06/03 0:34 UTC
Read the original article Hit count: 459

Filed under:
|
<?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

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql