Re[2]: [PHP] Function Problem (Long-ish)
| From: | Richard Davey | Date: | Tue, 13 Jan 2004 13:08:39 +0000 |
| Subject: | Re[2]: [PHP] Function Problem (Long-ish) | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-174434@lists.php.net to get a copy of this message | ||
Hello Dave,
Tuesday, January 13, 2004, 12:57:35 PM, you wrote:
DC> If I use this sql in my func:
DC> $sql = mysql_query("select count(fieldtocount) as cnt, sum(fieldforsum) as
DC> total from $tab3 where fieldtocompare =\"$varcomparedwith\"");
DC> Then all is fine and works as expected.
Is this MySQL? If so you can't have a COUNT + SUM without a GROUP BY.
--
Best regards,
Richard mailto:rich@launchcode.co.uk