takeiteasy Posted July 11, 2006 Share Posted July 11, 2006 Hi there,Just want to ask if there's any PHP code that can display the data which has just been stored in the database?thanks Quote Link to comment https://forums.phpfreaks.com/topic/14275-view-previous-entry/ Share on other sites More sharing options...
ToonMariner Posted July 11, 2006 Share Posted July 11, 2006 mysql_insert_id(); Quote Link to comment https://forums.phpfreaks.com/topic/14275-view-previous-entry/#findComment-56087 Share on other sites More sharing options...
takeiteasy Posted July 11, 2006 Author Share Posted July 11, 2006 can u further explain on how this code works?thanks Quote Link to comment https://forums.phpfreaks.com/topic/14275-view-previous-entry/#findComment-56090 Share on other sites More sharing options...
brown2005 Posted July 11, 2006 Share Posted July 11, 2006 yeah use mysql_insert_id(); to select the record last inserted and then call it using this$inserted_id = mysql_insert_id(); $sql = "SELECT * FROM table WHERE id='$inserted_id ' LIMIT 1";$query = mysql_query($sql ) or die(mysql_error());while($array= mysql_fetch_array($query)){$array['fieldnames'];} Quote Link to comment https://forums.phpfreaks.com/topic/14275-view-previous-entry/#findComment-56092 Share on other sites More sharing options...
takeiteasy Posted July 11, 2006 Author Share Posted July 11, 2006 oh. i get it. thanks alot! ;) Quote Link to comment https://forums.phpfreaks.com/topic/14275-view-previous-entry/#findComment-56102 Share on other sites More sharing options...
brown2005 Posted July 11, 2006 Share Posted July 11, 2006 no problem, let me know if it works, :) Quote Link to comment https://forums.phpfreaks.com/topic/14275-view-previous-entry/#findComment-56103 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.