Xyphon Posted December 15, 2007 Author Share Posted December 15, 2007 That made it HORIBLY worse. Quote Link to comment Share on other sites More sharing options...
Xyphon Posted December 15, 2007 Author Share Posted December 15, 2007 Now bottom wont even display. Quote Link to comment Share on other sites More sharing options...
Xyphon Posted December 15, 2007 Author Share Posted December 15, 2007 Oh, it was just an error. Now it displays, but, guess what? Same layout problem. Quote Link to comment Share on other sites More sharing options...
phpSensei Posted December 15, 2007 Share Posted December 15, 2007 Its the script that is the problem this should work <?php include('Connect.php'); include('top.php'); $result = mysql_query("SELECT * FROM news_comments"); echo "<table border='1'> <tr> <th>Hi,<br /> It's Xyphon. I have just made the news page, I hope you like it! Please, leave comments here!</th> </tr></table>"; echo "<table border='1' width='500'>"; echo "<tr> <td> <a href='postcomment.php'>Post Comment</a></td>"; echo "<td> <a href='viewcomments.php'>View Comments</a></td></tr></table>"; if(mysql_num_rows($result)==0){ echo "There are no current comments. Layout issues may accure."; } else { while($row = mysql_fetch_array($result)){ echo "<table border='1' width='500' height='20'>"; echo "<br /><br />"; echo "<tr>"; echo "<td><center><b>Username: </b><br />" . $row['username'] . "</center></td>"; echo "<td><center><b>ID: </b><br />" . $row['user_id'] . "</center></td></tr></table>"; echo "<table border='1' width='500' height='20'><tr><td><b>Comment:</b>"; echo "<td>" . $row['comment'] . "</td>"; echo "</tr></table>"; } } echo "</table>"; include('bottom.php'); ?> Quote Link to comment Share on other sites More sharing options...
Xyphon Posted December 15, 2007 Author Share Posted December 15, 2007 Well, that made it normously worse, now it displays the layout tihng if there IS a comment. Quote Link to comment Share on other sites More sharing options...
phpSensei Posted December 15, 2007 Share Posted December 15, 2007 I fixed one problem echo "<table border='1' width='500' height='20'>"; echo "<br /><br />"; echo "<tr>"; echo "<td><center><b>Username: </b><br />" . $row['username'] . "</center></td>"; echo "<td><center><b>ID: </b><br />" . $row['user_id'] . "</center></td></tr></table>"; echo "<table border='1' width='500' height='20'><tr><td><b>Comment:</b>"; echo "<td>" . $row['comment'] . "</td>"; echo "</tr></table>"; You were missing a </table>, which merge <td> with the bottom.php page. I am still looking. Like i said, I am horrible with HTML. Quote Link to comment Share on other sites More sharing options...
Xyphon Posted December 15, 2007 Author Share Posted December 15, 2007 I fixed one problem echo "<table border='1' width='500' height='20'>"; echo "<br /><br />"; echo "<tr>"; echo "<td><center><b>Username: </b><br />" . $row['username'] . "</center></td>"; echo "<td><center><b>ID: </b><br />" . $row['user_id'] . "</center></td></tr></table>"; echo "<table border='1' width='500' height='20'><tr><td><b>Comment:</b>"; echo "<td>" . $row['comment'] . "</td>"; echo "</tr></table>"; You were missing a </table>, which merge <td> with the bottom.php page. I am still looking. Like i said, I am horrible with HTML. Nops it said echo "</tr>"; { echo "</table>"; Quote Link to comment Share on other sites More sharing options...
phpSensei Posted December 15, 2007 Share Posted December 15, 2007 http://ptcrpg.awardspace.com/viewcomments.php You didnt Change the script, it didnt echo </table> like I added to the script. You need to upload the script. Quote Link to comment Share on other sites More sharing options...
phpSensei Posted December 15, 2007 Share Posted December 15, 2007 Please replace the script. Remove all updates I made, including what I gave you for bottom.php just put this <?php include('Connect.php'); include('top.php'); $result = mysql_query("SELECT * FROM news_comments"); echo "<table border='1'> <tr> <th>Hi,<br /> It's Xyphon. I have just made the news page, I hope you like it! Please, leave comments here!</th> </tr></table>"; echo "<table border='1' width='500'>"; echo "<tr> <td> <a href='postcomment.php'>Post Comment</a></td>"; echo "<td> <a href='viewcomments.php'>View Comments</a></td></tr></table>"; if(!$row = mysql_fetch_array($result)){ echo "There are no current comments. Layout issues may accure."; } else { echo "<table border='1' width='500' height='20'>"; echo "<br /><br />"; echo "<tr>"; echo "<td><center><b>Username: </b><br />" . $row['username'] . "</center></td>"; echo "<td><center><b>ID: </b><br />" . $row['user_id'] . "</center></td></tr></table>"; echo "<table border='1' width='500' height='20'><tr><td><b>Comment:</b>"; echo "<td>" . $row['comment'] . "</td>"; echo "</tr></table>"; } echo "</table>"; include('bottom.php'); ?> Quote Link to comment Share on other sites More sharing options...
Xyphon Posted December 15, 2007 Author Share Posted December 15, 2007 1. It was already updated before you fixed it! It says echo "</td>"; echo "</table>"; 2. Still has error. Quote Link to comment Share on other sites More sharing options...
phpSensei Posted December 15, 2007 Share Posted December 15, 2007 try this time it has to work. <?php include('Connect.php'); include('top.php'); $result = mysql_query("SELECT * FROM news_comments"); echo "<table border='1'> <tr> <th>Hi,<br /> It's Xyphon. I have just made the news page, I hope you like it! Please, leave comments here!</th> </tr></table>"; echo "<table border='1' width='500'>"; echo "<tr> <td> <a href='postcomment.php'>Post Comment</a></td>"; echo "<td> <a href='viewcomments.php'>View Comments</a></td></tr></table>"; if(!$row = mysql_fetch_array($result)){ echo "There are no current comments. Layout issues may accure."; } else { echo "<table border='1' width='500' height='20'>"; echo "<br /><br />"; echo "<tr>"; echo "<td><center><b>Username: </b><br />" . $row['username'] . "</center></td>"; echo "<td><center><b>ID: </b><br />" . $row['user_id'] . "</center></td></tr></table>"; echo "<table border='1' width='500' height='20'><tr><td><b>Comment:</b>"; echo "<td>" . $row['comment'] . "</td>"; echo "</tr></table>"; } include('bottom.php'); ?> problem isnt the php, its the HTML Quote Link to comment Share on other sites More sharing options...
Xyphon Posted December 15, 2007 Author Share Posted December 15, 2007 ast to is a very strong Wrong word. Still messed. Quote Link to comment Share on other sites More sharing options...
phpSensei Posted December 15, 2007 Share Posted December 15, 2007 http://ptcrpg.awardspace.com/viewcomments.php Works just fine Quote Link to comment Share on other sites More sharing options...
Xyphon Posted December 15, 2007 Author Share Posted December 15, 2007 Sorry, must have not uploaded when I lookd at it. Quote Link to comment Share on other sites More sharing options...
phpSensei Posted December 15, 2007 Share Posted December 15, 2007 Sorry, must have not uploaded when I lookd at it. No problem/ I should be sorry, I should have pointed to the problem in no time. I am just REALLLY horrible with HTML, and Layouts. Mark topic as solved please. Quote Link to comment Share on other sites More sharing options...
Xyphon Posted December 15, 2007 Author Share Posted December 15, 2007 Ugh. For some reason now my display will only display the FIRST comment made.. Quote Link to comment Share on other sites More sharing options...
phpSensei Posted December 15, 2007 Share Posted December 15, 2007 Ugh. For some reason now my display will only display the FIRST comment made.. Thats because you need to use a WHILE() statement. try <?php include('Connect.php'); include('top.php'); $result = mysql_query("SELECT * FROM news_comments"); echo "<table border='1'> <tr> <th>Hi,<br /> It's Xyphon. I have just made the news page, I hope you like it! Please, leave comments here!</th> </tr></table>"; echo "<table border='1' width='500'>"; echo "<tr> <td> <a href='postcomment.php'>Post Comment</a></td>"; echo "<td> <a href='viewcomments.php'>View Comments</a></td></tr></table>"; if(!$row = mysql_fetch_array($result)){ echo "There are no current comments. Layout issues may accure."; } else { while($row = mysql_fetch_array($result)){ echo "<table border='1' width='500' height='20'>"; echo "<br /><br />"; echo "<tr>"; echo "<td><center><b>Username: </b><br />" . $row['username'] . "</center></td>"; echo "<td><center><b>ID: </b><br />" . $row['user_id'] . "</center></td></tr></table>"; echo "<table border='1' width='500' height='20'><tr><td><b>Comment:</b>"; echo "<td>" . $row['comment'] . "</td>"; echo "</tr></table>"; } } include('bottom.php'); ?> Quote Link to comment Share on other sites More sharing options...
Xyphon Posted December 15, 2007 Author Share Posted December 15, 2007 Thank you:) Quote Link to comment Share on other sites More sharing options...
phpSensei Posted December 15, 2007 Share Posted December 15, 2007 Thank you:) No Problem Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.