tecmeister Posted April 30, 2009 Share Posted April 30, 2009 Hi Everyone, I'm trying to find out the correct php to create a new page after it has displayed 4 peaces of date from the mysql. I know how to limit it to only display four. How do I make it automatically create a new page for each four peaces of data? Thanks for your help, tecmeister. Link to comment https://forums.phpfreaks.com/topic/156280-help/ Share on other sites More sharing options...
Ken2k7 Posted April 30, 2009 Share Posted April 30, 2009 Are you speaking of pagination? Link to comment https://forums.phpfreaks.com/topic/156280-help/#findComment-822733 Share on other sites More sharing options...
Prismatic Posted April 30, 2009 Share Posted April 30, 2009 <?php // Get the ID from the URL, e.g, mypage.php?id=126 $id = (int)$_GET['id']; // Query the database for the row with that ID $query = mysql_query("SELECT * FROM my_table WHERE id = '{$id}' LIMIT 1"); // Get the data $data = mysql_fetch_array($query); // Now you have all the data for that one row die(print_r($data)); ?> Link to comment https://forums.phpfreaks.com/topic/156280-help/#findComment-822737 Share on other sites More sharing options...
tecmeister Posted April 30, 2009 Author Share Posted April 30, 2009 Thanks for the code Prismatic. I'm trying to display four feedback to each page and it automatically creates a new page for them. Is that the right code? Thanks for your help tecmeister. Link to comment https://forums.phpfreaks.com/topic/156280-help/#findComment-822748 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.