bug/incomplete code in getRecords default WHERE?

3 posts by 2 authors in: Forums > CMS Builder
Last Post: July 23, 2010   (RSS)

Re: [mjkayson] bug/incomplete code in getRecords default WHERE?

By Jason - July 23, 2010

Hi,

The purpose for the default WHERE clause is to allow CMS Builder to do automatic searching. If the name of a variable in the $_REQUEST array matches a field in the table being searched, it will be added as part of the WHERE clause. This is an extremely useful function, but sometimes causes a problem if you don't know it's there.

getRecords() does this by default, but you can tell it not to like this (example):



list($newsRecords,$newsMetaData)=getRecords(array(
'tableName' => 'news',
'allowSearch' => false,
));


Setting 'allowSearch' to false will stop the function from automatically creating a WHERE clause, however, you can still add your own WHERE clause if you wish.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] bug/incomplete code in getRecords default WHERE?

By mjkayson - July 23, 2010

ok great, thanks!