Fallen_angel Posted February 15, 2007 Share Posted February 15, 2007 Hi , I need a little bit of help tidying up the bellow search script, it does the search and returns the results perfectly however I wanted to make one expantion to it , I would like to make it so that it only displays a certain number of results per page , ( say 15 ) and over that number it gives a link to move onto the next 15 results . with the size of my tutorial system at the moment it isn't effecting me too badly but as it grows it will and i plan to have the content people working on it in a week or two anyways here is the code i have so far <html> <head> <title></title> </head> <body> <div class="search_bar"> <table><tr><td> <form name="form" action="search.php" method="Get"> <input class="whitebox" type="text" size="21" name="q" /></td><td class="go_button"> <input type="image" height="21px" src="./images/go.gif" name="Submit" /> </form></td></tr></table> </div> <?php $var = @$_GET['q'] ; $q=$_GET['q']; //Connect To database include "connect.php"; //collects Data $data=mysql_query(" SELECT t_id,t_notes,t_name,img FROM table WHERE file LIKE '%$q%' ") or die(mysql_error()); Print "<br><br><table class='print_list_alpha';>" ; while ($info= mysql_fetch_array($data) ) { Print "<tr class='result_row'><td><img src=./uploads/mini_thumbs/".$info['img']."></td><td class='result_col'><table><tr><td><a href=../tutorial.php?id=".$info['t_id']."><b>".$info['t_name']."</b></a></td><tr><td><p>"; Print substr($info['t_notes'],0,350); Print "<a href=../tutorial.php?id=".$info['t_id']."><b>.....</b></a></p></td></tr></table>"; } Print "</table>" ; ?> </body> </html> If someone could show me how to edit this or point me in the direction of a relevant guide ect I would be greatly appreciative. thankyou very much in advance regards, fallen_angel Link to comment https://forums.phpfreaks.com/topic/38613-splitting-up-search-results-onto-a-new-page/ Share on other sites More sharing options...
ted_chou12 Posted February 15, 2007 Share Posted February 15, 2007 Looks like what you want is pagination script, this might help you: http://www.phpfreaks.com/forums/index.php/topic,120064.0.html Link to comment https://forums.phpfreaks.com/topic/38613-splitting-up-search-results-onto-a-new-page/#findComment-185299 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.