Gruzin Posted September 20, 2006 Share Posted September 20, 2006 Hi guys,I have a very simple question: how can I echo the last row from db? Thanks for your time,George Quote Link to comment Share on other sites More sharing options...
obsidian Posted September 20, 2006 Share Posted September 20, 2006 if you have an auto-incrementing id field, you can simply sort by that field:[code]<?php$sql = mysql_query("SELECT * FROM table ORDER BY id DESC LIMIT 1");$row = mysql_fetch_row($sql);foreach ($row as $key => $val) echo "$key => $val<br />\n";?>[/code]hope this helps Quote Link to comment Share on other sites More sharing options...
Gruzin Posted September 20, 2006 Author Share Posted September 20, 2006 Thanks obsidian, think it will help me ;) 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.