<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("ms", $con);
$time1 = $row['timein'];
$time2 = $row['timeout'];
$sql = mysql_query("SELECT employees.*, timetable.* FROM employees INNER JOIN timetable ON
employees.id = timetable.id WHERE timetable.in_time BETWEEN employees.timein AND employees.timeout ");
echo "<table width='734'>
<tr>
<th width='49' scope='col'>Employee ID</th>
<th width='49' scope='col'>Lastname</th>
<th width='49' scope='col'>Firstname</th>
<th width='49' scope='col'>Department</th>
<th width='49' scope='col'>Time In</th>
<th width='49' scope='col'>Time Out</th>
</tr>";
while ($row = mysql_fetch_array($sql))
{
echo "<tr>";
echo "<td class='align-center'> " . $row['id'] . " </td>";
echo "<td> " . $row['Lastname'] ." </td>";
echo "<td> " . $row['Name'] . " </td>";
echo "<td> " . $row['Department'] . " </td>";
echo "<td class='align-center'> " . $row['in_time'] . " </td>";
echo "<td class='align-center'> " . $row['out_time'] . " </td>";
echo "</tr>";
};
echo "</table>";
mysql_close($con);
?>
shhh 0 Light Poster
LastMitch
shhh 0 Light Poster
shhh 0 Light Poster
urtrivedi 276 Nearly a Posting Virtuoso
shhh 0 Light Poster
urtrivedi 276 Nearly a Posting Virtuoso
shhh 0 Light Poster
LastMitch
shhh 0 Light Poster
LastMitch
urtrivedi 276 Nearly a Posting Virtuoso
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.