I need the group by clause to enable me pick the count of each type of item
that can be used for drawing graphs.Remember that it is not very possible,
although i don't know yet to come up with a chart of different number counts
of each item without converting the counts to numerical values.

-----Original Message-----
From: Nicole Amashta [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 24, 2002 12:52 AM
Subject: [PHP-WIN] Re: Passing Variables

Why do you need the group by clause? Do one or the other, not both.

either do a

select count(id) from table

select field, count(id) from table group by field

Check your query,

Nicole Amashta

James Opere wrote:
> Hi All,
>  I'm trying to pass variables from one form to the other.I have a problem
> when i want to do the the following:
> 1.COUNT($variable)
> 2.DISTINCT($variable)
> .............
> I realise i can not use the brackets in my query and the variable be
> recognised.When i add COUNT without the brackets i still get an error.
> Example.
> test.html
> <form action="me.php" method="post">
> <input type="text" name="this">
>  ..............
> This is sent to :
> me.php
> <?php 
> $db=mysql_connect('localhost','','');
> mysql_select_db($database,$db);
> $sql="select COUNT($this) from $table group by  $this";
> ................
> ?>
>  This  gives an error.
> Please help.

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

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

Reply via email to