|
Posted by Jerry Stuckle on 11/20/06 18:43
Auddog wrote:
> I have the following query that works in mysql:
>
> select id, order_no, price, count(item_no), sum(price) from production
> WHERE item_no = '27714'
> group by item_no;
>
> When I setup my query in php, I use:
>
> $query2 = "SELECT id, order_no, price, count(item_no) as count from
> production where item_no = '27714";
>
> I keep getting an error in on my php page:
>
> Warning: mysqli_error() expects exactly 1 parameter, 0 given in
> c:\Inetpub\wwwroot\production\production_line_daily.php on line 24
> Error in query: SELECT id, order_no, price, count(item_no) as count from
> production where item_no = '27714'.
>
> If I remove the count(item_no) as count from the query - it works fine. I
> really want to put the count in though. And eventually the sum.
>
> Any help that you can provide is greatly appreciated.
>
> A
>
>
If item_no is a numeric type should should NOT have single quotes around
it. Single quotes indicate a string.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Navigation:
[Reply to this message]
|