Hey,
Thanks for replying.

Nope, that didnt work, but i modified my search terms on google and kept on
trying with different search terms and got the solution here:
http://dbforums.com/arch/230/2002/11/623223

Cheers,
-Ryan


On 2/10/2004 3:14:21 AM, Shaunak Kashyap ([EMAIL PROTECTED])
wrote:
> Try this:
>
> "SELECT COUNT(*), order_number FROM " . $prefix .
> "_purchases GROUP BY
> order_number"
>
> as your query.
>
> Shaunak
>
> ----- Original Message -----
> From: "Ryan A" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, February 09, 2004 8:36 PM
> Subject: [PHP] php with mysql COUNT, DISTINCT syntax, might be a bit 0T
>
>
> > Hi,
> > I have a table where a users details are entered for the products he
> bought,
> > the only part that is repeated is the order_id,
> > I basically need to only get the order per person, and paginate for all
> the
> > customers
> >
> > eg:
> > if user "tom" bought 3 items in the database it would be entered as:
> > order_id      item_name
> > 0000023     soap
> > 0000023     brush
> > 0000023     towel
> >
> > So i am trying this:
> > $num_rows =
> mysql_result(mysql_query("SELECT COUNT(*),
> > DISTINCT(order_number)   FROM ".
> $prefix."_purchases"),0);
> >
> > (the idea being taht $num_rows will give my paginating part of the
> program
> > the total number of

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to