jboog Posted March 29, 2007 Share Posted March 29, 2007 I've got a site with several different types of objects and search forms for each. I'm not sure the most efficient(server-utilization-wise) way to implement the search results. The queries are almost all join statements and I have a fairly heavy organizing function the be sure the most relevant results come up first. The results will be split into multiple pages. Is it better to redo the search/organizing function on each page of results or to store the final array as a session variable...or other? Thanks Jared Link to comment https://forums.phpfreaks.com/topic/44729-site-search-function/ Share on other sites More sharing options...
boo_lolly Posted March 29, 2007 Share Posted March 29, 2007 look into OOP. grab some links from my signature. Link to comment https://forums.phpfreaks.com/topic/44729-site-search-function/#findComment-217196 Share on other sites More sharing options...
jboog Posted March 29, 2007 Author Share Posted March 29, 2007 Thanks for the links. I understand OOP. I guess I'm just not sure how PHP handles it. With each page load are instantiated objects maintained? Link to comment https://forums.phpfreaks.com/topic/44729-site-search-function/#findComment-217261 Share on other sites More sharing options...
rcorlew Posted March 29, 2007 Share Posted March 29, 2007 Are you using _SESSION varaibles to store the queries? You can try that so the server doesn't have to load them up everytime a page is loaded, just unset() and destroy the session when the search/view is over. Link to comment https://forums.phpfreaks.com/topic/44729-site-search-function/#findComment-217296 Share on other sites More sharing options...
jboog Posted March 29, 2007 Author Share Posted March 29, 2007 Its not generating the queries I'm worried about, but executing the queries and the organizing function that sorts the results by relevance. I'd prefer not to have to redo it with each page of results. Then again, I'm not sure if its more efficient to store a large result array as a $_SESSION variable. I admit I haven't had a chance to go through all the OOP stuff from boo_lolly (unfortunately this is a free time project), maybe just a yes or no if there is an alternative to those two options... Thanks for all the help Link to comment https://forums.phpfreaks.com/topic/44729-site-search-function/#findComment-217581 Share on other sites More sharing options...
boo_lolly Posted March 29, 2007 Share Posted March 29, 2007 the second 'tut' in the list is probably what you're looking for: http://www.tonymarston.net/php-mysql/databaseobjects.html this will help you dynamicise your queries. for your particular project i think you'd benefit from following it in an OO fashion. This way, you can break down the queries from vast to specific by extending your parent classes. try to get a graphical (visual) representation of the way you want your queries to be robust, and then impliment them by using classes. Link to comment https://forums.phpfreaks.com/topic/44729-site-search-function/#findComment-217604 Share on other sites More sharing options...
jboog Posted March 29, 2007 Author Share Posted March 29, 2007 Thanks. This looks really helpful. Link to comment https://forums.phpfreaks.com/topic/44729-site-search-function/#findComment-217632 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.