0
<?php
if(isset($_POST['lookup']))
{           
if(mysql_num_rows(mysql_query("SELECT * FROM bans WHERE value = '". filter($_POST['l_username']) ."'")) == 0) { echo "<div class=\"my-notify-success\"><b>Oops! The username you have entered was not found in the system and is not banned please try again.</b></div>"; }
else
{ 
$two = mysql_fetch_assoc(mysql_query("SELECT * FROM bans WHERE value = '" . filter($_POST['l_username']) . "'"))                          
?>
<?php
}}
?>
<table>
<tbody>
  <tr class="success">
  <td><?php echo $_POST['l_username']; ?></td>
  <td><?php echo $two['reason']; ?></td>
  <td><?php echo $two['added_by']; ?></td>
  <td><?php echo $two ['added_date']; ?>
</td>
</table>

The added_date row in my database is a unix time stamp and I'm fairly new to PHP I want to echo my added_date into a user friendly date.

Jashun
  • 13
  • 3
  • 1
    http://php.net/manual/en/datetime.settimestamp.php then `$dateTime->format('Y-m-d')` – bassxzero Nov 21 '16 at 16:17
  • Side note: if you're learning PHP, don't waste your time with the [legacy mysql extension](http://php.net/manual/en/book.mysql.php). It's been deprecated for several years and it's already been removed from PHP. Learning PDO should take the same effort and will actually allow you to do stuff that won't require an old server. – Álvaro González Nov 21 '16 at 16:36

0 Answers0