vRory
Unemployed.
- May 4, 2011
- 447
- 69
Could someone code a lil search engine that you can enter a username and it shows the list of chatslogs
my current chatlogs page;
my current chatlogs page;
PHP:
<?php $pagerank = 3; include "templates/header.php"; ?>
<div id="site_content">
<?php include "templates/sidebar.php"; ?>
<div id="content_container">
<div id="content">
<h1>{hotelName} Hotel ASE ::Command Logs</h1><hr/>
<div align="center">
<form method='post'>
<table class=" table-bordered table-condensed">
<tr>
<table width="675">
<tr>
<td><b>Username</b></td>
<td><b>Message</b></td>
<td><b>Time/Date</b></td>
</tr>
<?php // Make a MySQL Connection
$query = "SELECT * FROM chatlogs ORDER by id DESC limit 50";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result))
{
echo("<tr>");
echo("<td>" . $row['user_name'] . "</td>");
echo("<td>" . $row['message'] . "</a></td>");
// Now we convert the Unix timestamp to a humanley readable time
$timestamp = $row['timestamp'];
$date = date("D-m-Y H:i:s", $timestamp);
echo("<td>$date</td></tr>");
}
?>
</table>
</div>
</center>
<?php include "templates/footer.php"; ?>