problem with GROUP BY and ORDER BY
Posted on
16th Feb 2014 07:03 pm by
admin
i usually use this query to display the last 10 entries from a sql table:
Code: $query = "SELECT search_time, search_keywords FROM phpbb_popsearch ORDER BY search_time DESC limit 35";
as you can see it will order the results by "search_time" so the latest entries are listed first
Did you know?Explore Trending and Topic pages for more stories like this.
normally the result would be something like this:
Quotenew entry
duplicate
another entry
bla bla
348237
543543
duplicate
but now i just want to include a "GROUP BY" in this sql request
Code: $query = "SELECT search_time, search_keywords FROM phpbb_popsearch ORDER BY search_time DESC limit 35";
but with the GROUP BY my sql query isn't ordered correctly anymore.
the result would be something like this:
QuoteQuotenew entry
another entry
bla bla
348237
543543
duplicate
notice the "duplicate" entry was grouped together, but it's not in the second first position anymore ???
i was expecting a result like this:
Quotenew entry
duplicate
another entry
bla bla
348237
543543
Since entry called "duplicate" is the second last added entry....
i hope you understand what i mean
No comments posted yet
Your Answer:
Login to answer
175
43
Other forums
foreach and array need help combining
Hi guys.
Here's the code
Code: array(
'tag' => 'code',<
split values
I have values that are returned to me in this format:
name=>test,age=>49
Error: SQL Syntax; Line 1
Code:
<?php require "global_settings.php"; ?>
<title&g
Please Help my PHP Dating Function.
Hi everyone!
Well here is my code that displays this:
It works wonderful.
Sequencing or queuing parallel process
Scenario is as follows
There is one parent process say P1 and 4 child processes say A B C D
PHP code for a proxy
I was wondering which function I could use to create an online proxy tool. I was thinking cURL would
Quick Syntax Question
Hi folks,
I'm getting the following error: "unexpected T_LNUMBER". I'm trying to b
Question about GD library
I am trying to make an image that shows a random quote from my database.
However I want t
get url?
how do i get the url of the page i'm currently on, on my website.. i think its get header.. how do i
Pipe email to PHP - get mail adress from MySQL - send?
Hi all,
this is the challenge:
1) Our faculty at the college where I'm employed includ