Jump to content

If row doesnt exist


flemingmike

Recommended Posts

hello, i am having an issue with tables using incorrect data.

 

i have 2 columns, first is employee name, second is location

 

if the employee doesnt have a location for the current day, it is telling me he is at the same location as the guy in the row above him.  i need this to be blank.  is this possible?

Link to comment
Share on other sites

here it is:

 

$result9 = mysql_query("SELECT * FROM staff ORDER BY name");
while($row9 = mysql_fetch_array($result9))
{
$peid=$row9['eid'];
$pname=$row9['name'];

$result4 = mysql_query("SELECT * FROM schedule WHERE eid = '$peid' ORDER BY id DESC LIMIT 1");
while($row4 = mysql_fetch_array($result4))
{

  $sstatus=$row4['status'];


if("$sstatus" == "1") {
$sstatusout="<font color='#0000FF' size='4'>Waiting For Arrival</font>";
 }  

if("$sstatus" == "2") {
$sstatusout="<font color='#00FF00' size='4'>Signed In</font>";
 }  

if("$sstatus" == "3") {
$sstatusout="<font color='#FF0000' size='4'>Signed Out</font>";
 } 

}


  echo "<tr>";
  echo "<td align='center'>" . $pname . "</td>";
  echo "<td align='center'>";
     if(empty($sstatusout) ) {

 } else {
 echo "" . $sstatusout . "";
 }
echo "</td>";

  
  
  
  echo "</tr>";
  
  }
echo "</table>";

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.