Advanced Filter assistance

9 years 3 weeks ago #142585 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
9 years 3 weeks ago #142681 by krileon
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 - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
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 EST to 4:00 PM EST. 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.
Moderators: beatnantkrileon
Time to create page: 0.395 seconds
Facebook Twitter Google LinkedIn