Questions: Ambiguous Column when using *_match with left join and allowSearch CMSB 3.75

3 posts by 2 authors in: Forums > CMS Builder
Last Post: 5 hours ago   (RSS)

Hi Jeff, 

If you can tell me the two table names, the column you want to join on, and what fields you want to search on, I can write some ZenDB code for you.

Dave Edis - Senior Developer
interactivetools.com

I was using getRecords.

list($biosRecords, $biosMetaData) = getRecords(
    array(
        'tableName'   => "bios",
        'loadUploads' => true,
        'where'       => $where,
        'orderBy'     => $orderby,
        'allowSearch' => true,
        'perPage'     => 10,
        'leftJoin'    => array(
            'locations' => 'company'
        ),
        'limit'       => '1',
        'requireSearchMatch' => false,
        'debugSql'  => false,
    )
);

I was using a query string of ?category_match=13. This seemed to work until CMSB 3.75. Both tables have a category column, which is where I got the ambiguous column name.

I found I could use bios_category_match, and it worked. However, I see the value gets set in the $_REQUEST to 'bios.category_match'. If this is submitted, it is changed. PHP replaces the dot with an underscore by default.

I am a bit confused on the proper way to use _match.

Jeff Shields
yaadev.com