The topic code is as follows:
<paste code here>
Expand|Select|Wrap|Line Numbers
- $sql = "SELECT * FROM box ORDER BY time DESC LIMIT 10 ";
- $result = mysql_query($sql) or die(mysql_error());
- while ($row = mysql_fetch_array($result)) {
- $message = $row['message'];
- $title=$row['title'];
- // replace smileys by images
- $sql2 = "SELECT * FROM smileys";
- $result2 = mysql_query($sql2) or die(mysql_error());
- while ($row2 = mysql_fetch_array($result2)) {
- $message = str_replace($row2['text'], "<img src = 'images/".$row2['image']."'>", $message);
- }
- $age = time() - $row['time'];
- if ($age < 60) {
- $bgcolor = "#FF0000";
- } elseif ($age < 300) {
- $bgcolor = "#FF4444";
- } elseif ($age < 1200) {
- $bgcolor = "#FF8888";
- } elseif ($age < 2400) {
- $bgcolor = "#FFBBBB";
- } else {
- $bgcolor = "#FFFFFF";
- }
- echo "<table width='100%' border='1' cellspacing='2' cellpadding='0'>";
- echo "<tr><th width='20%'>Topic Title</th>
- <th><div align='right'>
- <p align='left'>$title</p>
- </div></th>";
- echo"<tr><th width='20%'scope='col' bgcolor=";
- echo $bgcolor;
- echo ">";
- echo "<div align='center'><img src='images/mact.jpg' align='center'></div>";
- echo"<br>";
- echo "Time: ".date("d/m H:i", $row['time'])." ";
- echo"<br>";
- echo "<i>";
- echo "User Name:".$row['name'];
- echo"</th>";
- echo"<th width='80%' align='left'>";
- echo "</i> <br>";
- echo $message;
- echo"</th></tr>";
- echo "<tr><th> </th>
- <th><div align='right'>
- <p align='right'><img src='images/reply.JPG' width='14' height='16'><a href='index.php'>reply</a> <img src='images/quate.JPG' width='16' height='16'><a href='file:///C|/xampp/htdocs/fyp/forum/Tournaments.php'> Quate</a></p>
- </div></th>
- </table>";
this is the code to retrieve the new posted topices and display new posted topics, but somehow don;t know where is wrong, the new posted topic cant be displayed.
so how should i solve this problem and how should i do reply form page?
Is any1 able to help me out please...? THANKS in advance for your help :)