ok so i have this very simple code:
Code: $query = "SELECT search_keywords, COUNT(search_keywords) AS counter FROM phpbb_popsearch GROUP BY search_keywords ORDER BY counter DESC limit 5";
$res = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($res)) {
$term = $row["search_keywords"];
echo $term;
}
phpbb_popsearch is a table where i put the last search terms used in my forum search engine
this code will group together the same terms and list the 5 most popular terms
my problem is that the results will be ordered by "counter" which is the number of time a term has been found.
I want to get the 5 most popular results AND THEN, AFTER, list the results alphabetically
if i sort the results alphabetically right in the sql query (replacing "ORDER BY counter" by "ORDER BY search_keywords") it will not work correctly because it will not get the 5 most popular terms but just the 5 first terms, alphabetically sorting them and ignoring the number of times the term has been found
thanks for help
Validation
Hello I know this is a really vag question.I need to have a input field on a form that only submit's if the text inserted starts with any two letters and any four numbers
void* and sizeof()
Hi,Using void* and sizeof is it possible to get the value of the object ?I understand that dereferencing a void pointer is not directly possible. Is there a way (like casting) or something else to get
Memory Allocation
Hi folks,see this ex:int v=5;v=v+10;then what will do the compiler before the output come as 15.Please explain me technically.
php code generators
AllWhilst enjoying learning a new language i have come accross a number of free code generators out there to assist and save a lot of timecan anyone recommend what are the best free code generators
Baffled by Undefined Index in Simple Array: Please Help!
Hello. I have a form which posts an array to this script. However, I can't seem to access the values in the array; I keep getting an undefined index. Something is not right, but the code is so simple!
Why does first ever HttpSendRequest take longer?
I promise this isn't as simple as it sounds. I'm wondering why the the first ever call to HttpSendRequest takes much longer than subsequent calls, even when the later requests are for a different URL.
InternetOpenUrl() Invalid cert
Hi all,
Refining of search Criteria
Dear FriendsI need a help, I have a search page which of cars related, which has different search criteria e.g. maker, model, color, displacement etc. when i give any search criteria and click the
Displaying Multidimensional Arrays...about to put my head in a vice, PLEASE HELP
I am fairly new to PHP and MySQL and I have a problem which I have been trying to resolve for days. I just can't figure it out and can't find anything on the web that is helping me work it out.I hope
search query in mysql in php problem
my search query wont work, i know, that my codes are correct.please helpCode: [Select]<table width="300" border="0" align="center" cellpadding="0"