shlomikalfa Posted September 22, 2008 Share Posted September 22, 2008 hey there i would like to make a "Most Searched List" list in my site... it should capture all searches done in a certain period (1 month) and sort out just the top 10 repeating searches.... how do i do it using php & mysql ? Link to comment https://forums.phpfreaks.com/topic/125360-in-need-for-an-idea-how-to/ Share on other sites More sharing options...
Maq Posted September 22, 2008 Share Posted September 22, 2008 What does your data base look like? Link to comment https://forums.phpfreaks.com/topic/125360-in-need-for-an-idea-how-to/#findComment-648007 Share on other sites More sharing options...
shlomikalfa Posted September 22, 2008 Author Share Posted September 22, 2008 it doesn't... i will create the searches table only after i'll know how to make it... Link to comment https://forums.phpfreaks.com/topic/125360-in-need-for-an-idea-how-to/#findComment-648019 Share on other sites More sharing options...
Maq Posted September 22, 2008 Share Posted September 22, 2008 Umm, I hope you have a data base set up... You need to create some tables and fields first before we can help you with the code. Link to comment https://forums.phpfreaks.com/topic/125360-in-need-for-an-idea-how-to/#findComment-648029 Share on other sites More sharing options...
shlomikalfa Posted September 22, 2008 Author Share Posted September 22, 2008 What ?! no i don't.... i am looking for an IDEA.... mate... how do i do it theoretically ??? what do i place in the tables/rows ?! how do i search it afterward ? should i create a new row for each search done ? should i shove some together ? what is the concept ??? ummzz... not trying to annoy you... thanks a lot for reading... but i need this solved... not discussed Link to comment https://forums.phpfreaks.com/topic/125360-in-need-for-an-idea-how-to/#findComment-648076 Share on other sites More sharing options...
DarkWater Posted September 22, 2008 Share Posted September 22, 2008 He means that you need to have a database set up for content to search at least...o_O Link to comment https://forums.phpfreaks.com/topic/125360-in-need-for-an-idea-how-to/#findComment-648173 Share on other sites More sharing options...
Yesideez Posted September 22, 2008 Share Posted September 22, 2008 Basic form... Everything used to search with is stored inside a dedicated table (say "searchterms") termid INT UNSIGNED PRIMARY AUTOINC term VARCHAR[80] count INT UNSIGNED OK, not quite exactly MySQL I'm tired Before you add a search term check if it exists already. If it does, increase the counter by one. If not, add it with a count of 1. As the searches are performed this little table will increase in size. Then, to view the top 10 use something like this: SELECT * FROM `searchterms` ORDER BY `count` DESC LIMIT 0,10 Link to comment https://forums.phpfreaks.com/topic/125360-in-need-for-an-idea-how-to/#findComment-648176 Share on other sites More sharing options...
Guest Xanza Posted September 22, 2008 Share Posted September 22, 2008 Basically what these guys are talking about: You have to have some sort of repository for the data that is to be collected. Then you can make a script to run through the dad and be able to determine which is the most searched. For this you can do one of two things; that I know of. Either a flatfile database (a singular textfile containing your data); or a MySQL database to more efficiently hold your data. Once you have a way to store the files, then a process can be developed to poll for information. Link to comment https://forums.phpfreaks.com/topic/125360-in-need-for-an-idea-how-to/#findComment-648228 Share on other sites More sharing options...
shlomikalfa Posted September 23, 2008 Author Share Posted September 23, 2008 @Yesideez yeps.. that's what i thought... but then i figured after a while this table will consume my database size... as there will be 10K searches a month... wouldn't it be so ?! Link to comment https://forums.phpfreaks.com/topic/125360-in-need-for-an-idea-how-to/#findComment-648439 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.