orderBy Search Results

15 posts by 3 authors in: Forums > CMS Builder
Last Post: May 8, 2013   (RSS)

By Jason - May 8, 2013

Hi, 

Could you set debugSql to 1 and then post the output?

Thanks

---------------------------------------------------
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 s2smedia - May 8, 2013

SELECT SQL_CALC_FOUND_ROWS * FROM ( SELECT 'products' as `tablename`, num, `item` as `_title`, `item_description` as `_summary`, `pattern` as `field1`, `size` as `field2`, '' as `field3`, '' as `field4`, '' as `field5`, '' as `field6`, '' as `field7`, '' as `field8`, '' as `field9`, '' as `field10`, CONCAT_WS('\t', `item`, `item_description`, `pattern`) as _content FROM `cms_products` ) as combinedTable WHERE (`_content` LIKE '%55%') ORDER BY itemLIMIT 10 OFFSET 0

By Jason - May 8, 2013

Hi,

Okay, it looks like there's a small bug in the script that produces the query when using orderBy.  To get around this issue, try putting a space after "item" like this;

$searchOptions['orderBy'] = "item ";

Let me know if that works for you.

Thanks!

---------------------------------------------------
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 s2smedia - May 8, 2013

getting there...

now get this:

SELECT SQL_CALC_FOUND_ROWS * FROM ( SELECT 'products' as `tablename`, num, `item` as `_title`, `item_description` as `_summary`, `pattern` as `field1`, `size` as `field2`, '' as `field3`, '' as `field4`, '' as `field5`, '' as `field6`, '' as `field7`, '' as `field8`, '' as `field9`, '' as `field10`, CONCAT_WS('\t', `item`, `item_description`, `pattern`) as _content FROM `cms_products` ) as combinedTable WHERE (`_content` LIKE '%55%') ORDER BY item LIMIT 10 OFFSET 0

Search Multiple Tables: MySQL Error: Unknown column 'item' in 'order clause'