herghost Posted September 24, 2009 Share Posted September 24, 2009 Hi all, heres my code: <?php include('../include/dbconnect.php'); ?> <p> Welcome to the solutions center. Here you can view all problems and answers posted on the website. These are arranged by category. Please click on the post title to view that post</p> <br> <h3>Last 10 Posts</h3></p> <table> <tr> <th><strong>Post</strong> Date</th> <th width="20%">Category</th> <th width="40%">Title</th> <th>Views</th> <th>Replies</th> </tr> <?php $query="SELECT * FROM forum_question ORDER BY id DESC LIMIT 10"; $result=mysql_query($query) or die ("fucked" .mysql_error()); while($rows=mysql_fetch_array($result)) { ?> <tr><? echo $rows['datetime']; ?></tr> <tr><? echo $rows['cat']; ?></tr> <tr><? echo $rows['title']; ?></tr> <tr><? echo $rows['views']; ?></tr> <tr><? echo $rows['replies']; ?></tr> <?php } ?> </table> Now while the table itsself appears (I can see the TH's) No data is filling the table, the data exist in the database but is not posting in the table? No errors to report on screen. ANy ideas? Thanks Link to comment https://forums.phpfreaks.com/topic/175319-solved-pulling-info-from-database-and-displaying-in-database/ Share on other sites More sharing options...
PFMaBiSmAd Posted September 24, 2009 Share Posted September 24, 2009 When you do a "view source" of the page in your browser, what do you see? If you see the raw php code - <? echo $rows['datetime']; ?>, then please, please, please only use full opening php tags <?php as the short open tag <? is not always enabled and you won't always be on a server where you will have the ability to enable them. Link to comment https://forums.phpfreaks.com/topic/175319-solved-pulling-info-from-database-and-displaying-in-database/#findComment-923958 Share on other sites More sharing options...
Handy PHP Posted September 24, 2009 Share Posted September 24, 2009 Well, this is more of an HTML problem... You don't have table cells "<TD>". Try this: <tr> <td><? echo $rows['datetime']; ?></td> <td><? echo $rows['cat']; ?></td> <td><? echo $rows['title']; ?></td> <td><? echo $rows['views']; ?></td> <td><? echo $rows['replies']; ?></td> </tr> Hope this helps, Handy PHP Link to comment https://forums.phpfreaks.com/topic/175319-solved-pulling-info-from-database-and-displaying-in-database/#findComment-923959 Share on other sites More sharing options...
herghost Posted September 24, 2009 Author Share Posted September 24, 2009 Damn, thanks to both of you, I didn't even reliase id gone back into short tags.... I turned them off a good two years ago, quick memory slip me thinks! and thanks for the basic html lesson Once the fingers get going its hard to stop them.... Link to comment https://forums.phpfreaks.com/topic/175319-solved-pulling-info-from-database-and-displaying-in-database/#findComment-923961 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.