Remove record num from _link

23 posts by 4 authors in: Forums > CMS Builder
Last Post: December 12, 2012   (RSS)

By Jason - December 12, 2012

Hi Kevin,

There isn't a trim taking place, since the only difference between the 2 tests is the presence of a trailing space inside the record, which wouldn't appear in the query. One thing you can try is to trim the address field in the database from inside your where clause like this:

// load records
list($listingsRecords, $listingsMetaData) = getRecords(array(
'tableName' => 'listings',
'where' => " TRIM(address) LIKE '".mysql_escape($title_like)."'",
'limit' => '1',
));


This should remove any leading or trailing spaces before the LIKE comparison is done.

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/

By weblm - December 12, 2012

Jason thanks! That looks like it's working.

Any ideas what was happening? Still not sure I completely understand all the preg_replace code.

Thanks for the help!

-Kevin
LM