Ernster Posted June 15, 2006 Share Posted June 15, 2006 Hi I need some help, I am a huge newbie to PHP so please dont talk to technical. Basically im building a joomla site anyway I dont how to show the latest 5 records (basically the text submitted in text boxes on a page) I want to show the 5 most ecent entriesthe same page just beneath the text boxes. How do I do this and which variables/tags do I need to use? Thanks. Link to comment https://forums.phpfreaks.com/topic/12043-showing-newest-records/ Share on other sites More sharing options...
joquius Posted June 15, 2006 Share Posted June 15, 2006 I'm assuming these entries are from a db? probably an sql db? what kind of page is this, are these items listed elsewhere? is this stuff already logged by the site? Be a bit more specific about it.In any case if they're from the db you need to know the fields, and the id field which I assume it has$sql = "SELECT * FROM `table` ORDER BY `id` DESC LIMIT 5";$result = mysql_query ($sql) or die (mysql_error ());while ($data = mysql_fetch_array ($result)){ ?><tr><td><?=$data['text']?></td> etc.... <?} Link to comment https://forums.phpfreaks.com/topic/12043-showing-newest-records/#findComment-45821 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.