I have 2 tables:
Usertable
Userid, username, mobile, status
1, Alan, 123456, 1
Status
Statusid, status
1, invalid
2, valid
$query = "SELECT userid, username, mobile, status from usertableā;
$result = mysql_query($query);
<?php
while(list($userid, $username,, $mobile, $status) = mysql_fetch_array($result))
{
?>
<table>
<tr align="left">
<td width="140">
<?php echo $username;?>
</td>
<td width="100">
<?php echo $mobile;?>
</td>
<td width="50">
<?php echo $status;?>
</td>
</table>
<?php } ?>
How can I change the select SQL to show the status value?
If it is 1, then show invalid in the row
If it is 2, then display valid in the row
But not just show the number 1 or 2.