Custom sql query for getting values of a checkbox field

More
9 years 5 months ago - 9 years 3 months ago #51289 by rafah
Hi,

I have created a checkbox field in my application.I have added multiple values to it through admin panel in this field.My question is how to get these values(also insert new values) and corresponding text from database by using custom sql query.Please help me
Last edit: 9 years 3 months ago by rafah.

Please Log in or Create an account to join the conversation.

More
9 years 5 months ago #51295 by micker
read config of sql value input all is in
ex :

This mode allows you to build the list dynamically with SQL queries. If you select this mode, put you query in the field elements. It must return a text and a value, for example SELECT id AS value, name AS text from #__users . You can put replacement of item data like: {item->created_by} {item->catid} etc and field replacement like: {field->id} etc and for language (in frontend) like: {curr_userlang_shorttag} {curr_userlang_fulltag}


FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

More
9 years 3 months ago #52116 by rafah
Hi,

Still I dint get an idea.sorry.
The value I am having in database is

{"display_label":"1","show_acc_msg":"0","no_acc_msg":"","sql_mode":"0","field_elements":"1::Hair Salon%% 2::Unisex Salon%% 3::Spa Service%% 4::Skin care%%5::Hair Colouring%% 6::Manicure & Pedicure%%7::Foot massage%%8::Gym Service%%9::Luxury Spa%%","text_or_value":"1","display_all":"0","trigger_onprepare_content":"0","remove_space":"0","pretext":" ","posttext":":","separatorf":"5","opentag":"Category-","closetag":"","ns_pretext":"","ns_posttext":"","default_values":"","required":"0","pretext_form":"","posttext_form":"","separator":"0","opentag_form":"","closetag_form":"","max_values":"0","min_values":"0","exact_values":"0","filter_customize_options":"0","filter_custom_options":"SELECT value, value as text FROM #__flexicontent_fields_item_relations WHERE field_id='{field_id}' AND value != '' GROUP BY value","filter_default_value":"","filter_usefirstoption":"1","filter_firstoptiontext":"FLEXI_ALL","filter_compare_type":"0","filter_values_require_all":"0","filter_values_require_all_tip":"0","display_label_filter":"2","display_filter_as":"4","faceted_filter":"2","show_matching_items":"1","hide_disabled_values":"0","display_label_filter_s":"2","display_filter_as_s":"0","faceted_filter_s":"2","show_matching_items_s":"1","hide_disabled_values_s":"0"}


From this how can I get text values of 1,2,3 for eg.hair salon,unisex salon,spa service.etc

Please Log in or Create an account to join the conversation.

More
9 years 3 months ago #52132 by micker
put your sql request

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

More
9 years 3 months ago #52135 by rafah
Hi,

sorry I dint get it.I tried your query.But I am not getting the text value.

Please Log in or Create an account to join the conversation.

More
9 years 3 months ago #52151 by micker
its an exemple :lol:

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.275 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline