Advanced Filter assistance

13 years 6 months ago #142585 by margaret@theictshak.com.a
Advanced Filter assistance was created by margaret@theictshak.com.a
Hi
I am trying to write the sql for an advanced filter but not sure how to write the table/field for accessing the cb_foodtype that is the same as the jos_menu.name.
Is this possible. if so it will save my writing about 50 individual lists.
Here is my lame attempt. I realise that there are might be some syntax errors also but not too sure of the syntax required.

cb_foodtype LIKE ( SELECT `name` FROM `#__menu`)

Thanks in advance for the assistance.

Margaret

Post edited by: margaret@theictshak.com.a, at: 2010/09/22 02:36

Please Log in to join the conversation.

13 years 6 months ago #142681 by krileon
Replied by krileon on topic Re:Advanced Filter assistance
The below should work fine I suppose, but you've no WHERE attribute so it's not very defined. You've also posted in CB 1.2.2 boards, please upgrade to CB 1.2.3.

[code:1]
'[cb_foodtype]' LIKE ( SELECT `name` FROM `#__menu` LIMIT 1 )
[/code:1]

Syntax is the same as any query. Test within phpmyadmin. Example of the above tested in phpmyadmin as follows.

[code:1]
'fruit' LIKE ( SELECT `name` FROM `jos_menu` LIMIT 1 )
[/code:1]

The limit is required because your query will contain more then 1 row and won't work. I recommend the following documentation for more MYSQL usage information.

dev.mysql.com/doc/refman/5.0/en/index.html


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.183 seconds

Facebook Twitter LinkedIn