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,
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:
> 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.
> <form action="me.php" method="post">
> <input type="text" name="this">
> This is sent to :
> $sql="select COUNT($this) from $table group by $this";
> This gives an error.
> Please help.
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php