Page 1 of 1

'Attempt to use array in query clause' during action handlin

PostPosted: Tue Oct 25, 2011 2:38 am
by FractalizeR
Hi.

I need to post array data in my action's form like this:

Code: Select all
           <tr id="country">
                <td>Country:</td>
                <td>
                    <select name="country[]">
                        {foreach from=$countries key=countryCode item=countryName}
                            <option value="{$countryCode}">{$countryName}</option>
                        {/foreach}
                    </select>
                </td>
            </tr>


Form submission method is 'post' here.

But Xataface throws exception
Code: Select all
Fatal error: Uncaught exception 'Exception' with message 'Attempt to use array in query clause' in T:\home\smartgsm.local\www\xataface\Dataface\QueryBuilder.php on line 503


How can I workaround that?

Stack trace:
Code: Select all
( ! ) Fatal error: Uncaught exception 'Exception' with message 'Attempt to use array in query clause' in T:\home\smartgsm.local\www\xataface\Dataface\QueryBuilder.php on line 503
( ! ) Exception: Attempt to use array in query clause in T:\home\smartgsm.local\www\xataface\Dataface\QueryBuilder.php on line 503
Call Stack
#   Time   Memory   Function   Location
1   0.0009   335936   {main}( )   ..\index.php:0
2   0.0285   1683176   Dataface_Application->display( )   ..\index.php:19
3   0.0388   2127264   Dataface_Application->handleRequest( )   ..\Application.php:1728
4   0.1550   6908000   Dataface_ActionTool->getAction( )   ..\Application.php:1078
5   0.1550   6908032   Dataface_ActionTool->_loadTableActions( )   ..\ActionTool.php:93
6   0.1550   6908216   Dataface_Table->getActions( )   ..\ActionTool.php:79
7   0.1570   6986832   Dataface_ActionTool->getActions( )   ..\Table.php:1803
8   0.1583   7002304   Dataface_Application->checkPermission( )   ..\ActionTool.php:216
9   0.1583   7002304   Dataface_Application->getPermissions( )   ..\Application.php:1526
10   0.1583   7002424   Dataface_Application->getRecord( )   ..\Application.php:1507
11   0.1583   7002856   Dataface_Application->getResultSet( )   ..\Application.php:1317
12   0.1664   7661664   Dataface_QueryTool::loadResult( )   ..\Application.php:1288
13   0.1664   7662728   Dataface_QueryTool->Dataface_QueryTool( )   ..\QueryTool.php:531
14   0.1673   7667176   Dataface_QueryBuilder->select_num_rows( )   ..\QueryTool.php:120
15   0.1675   7668144   Dataface_QueryBuilder->_where( )   ..\QueryBuilder.php:258
16   0.1679   7670328   Dataface_QueryBuilder->_fieldWhereClause( )   ..\QueryBuilder.php:665

Re: 'Attempt to use array in query clause' during action han

PostPosted: Wed Oct 26, 2011 6:50 am
by FractalizeR
Changing <select> tag name into country_name worked. It seems, that country is a reserved word in Xataface. It would be good to have all such listed somewhere.