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

A place for users and developers of the Xataface to discuss and receive support.

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

Postby FractalizeR » Tue Oct 25, 2011 2:38 am

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
FractalizeR
 
Posts: 19
Joined: Tue Oct 04, 2011 5:26 am

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

Postby FractalizeR » Wed Oct 26, 2011 6:50 am

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.
FractalizeR
 
Posts: 19
Joined: Tue Oct 04, 2011 5:26 am


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 5 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved