DanielHardy Posted November 17, 2008 Share Posted November 17, 2008 Hi, I have a very simple search code that searches my database and displays results on the page. However, with certain searches there is too many results and the results interfere with the design of my page. Therefore I need to print out only a certain amount of results, and include a "next results" link or something similar. Here is my script : <?php mysql_connect ("localhost", "root","") or die (mysql_error()); mysql_select_db ("wyrleyjuniors"); $term = $_POST['term']; $sql = mysql_query("select * from players where Player like '%$term%'"); while ($row = mysql_fetch_array($sql)) { echo $_POST['$term']; echo '<b><font color ="red">Name:</font></b> '.$row['Player']; echo '<b><font color ="red"> Position:</font></b> '.$row['Position']; echo '<p><b><font color ="red">Team:</font></b> '.$row['Team']; echo '<br/><br/>'; } ?> Could someone please tell me how to do achieve my aim? I know I need to use something like "$limit = 0;" but I'm not sure how to integrate it. All help will be greatly appreciated. Dan Link to comment https://forums.phpfreaks.com/topic/133095-number-of-search-results-to-display/ Share on other sites More sharing options...
genericnumber1 Posted November 17, 2008 Share Posted November 17, 2008 It's called pagination. There are thousands of tutorials out there and all you needed to know was "pagination" to be able to tap the limitless cloud of information. Go forth and consult the mighty google! Link to comment https://forums.phpfreaks.com/topic/133095-number-of-search-results-to-display/#findComment-692136 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.