This topic is locked

Total from details table to master table filed

6/13/2007 9:25:02 AM
PHPRunner General questions
C
c2dinc author

How to put sum(price) from detail table in Master table field.
this is the sql that I wrote.
select `groupID`,

`OnsiteID`,

`Attendee`,

`Type`,

`Payee`,

`church`,

(select sum(price) from _onsite_order_detail where groupID = _onsite_group.groupID) as `subtotal`

From `_onsite_group`
I can see the results from master table, but now I cant go into the detail table except from the jump menu.
ERROR

____

__-
PHP error happened
Technical information

Error type

256
Error description

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') and (`OnsiteID`=241)' at line 1
URL

www.c2dinc.com/nbca/backend/_onsite_group_list.php?mastertable=%5Fonsite%5Forders&masterkey1=241
Error file

/home/c2dinc/public_html/nbca/backend/include/dbconnection.php
Error line

26
SQL query

select `groupID`, `OnsiteID`, `Attendee`, `Type`, `Payee`, `church`, (select sum(price) from _onsite_order_detail where (groupID = _onsite_group.groupID) as `subtotal` From `_onsite_group`) and (`OnsiteID`=241)
Solution

This is a general error. It occurs when thereis an error in event code or in SQL.
Send your SQL or event code along with full error message tosupport@xlinesoft.com.

Alexey admin 6/13/2007

Hi,
PHPRunner doesn't support subqueries fully.
To get your pages working add a dummy WHERE expression to your SQL query

I.e.

select `groupID`,

...

From `_onsite_group`

where 1=1



We'll add full subqueries support in the next version of PHPRunner.