Checkbox mysql query

More
8 years 6 months ago - 8 years 6 months ago #56868 by iamrobert
Hi,

I am thinking about using the mysql query for checkbox. Now - I have a type called "innovation" - its only one page, and I want to put those values into a type called "wheels".

Now the following allows me to render the title:
Code:
SELECT field_id, value as value, value as text FROM `zv4so_flexicontent_fields_item_relations` WHERE item_id = 33 AND field_id = 59 ORDER BY `text` ASC

and it appears in the "wheels" template. But - how do I pull the other values into it?

I have an image field called "inno_image" and I also want to put that into the template when I call the text group.

Sorry - I am looking for some more explicit examples.

Cheers,

Robert
Last edit: 8 years 6 months ago by iamrobert.

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

More
8 years 6 months ago - 8 years 6 months ago #56870 by ggppdk
Replied by ggppdk on topic Checkbox mysql query
Hello

by reading you post i don't understand which data will displayed by the field

Format of SQL query is:
Code:
SELECT some_column1 as value, some_column2 as text, some_column3 as image, some_column4 as valgrp FROM some_table JOIN .... WHERE ... ORDER ...

these are optional (include only if using the cascade feature):
... as image, ... as valgrp


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...
Last edit: 8 years 6 months ago by ggppdk.

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

More
8 years 6 months ago - 8 years 6 months ago #56871 by iamrobert
Replied by iamrobert on topic Checkbox mysql query
Sorry - I am a little dense with this.

Here is my FLEXIcontent Group for content type "Innovation"



Now - I want to pull those values into content type "Wheels"



So - when the user checks the box - the field group will appear.

Does that make sense? Is that possible?

I am trying to build the features box:
taichungdesigner.com/t2015/comp2/

Thanks,

Robert
Attachments:
Last edit: 8 years 6 months ago by iamrobert.

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

More
8 years 6 months ago #56874 by ggppdk
Replied by ggppdk on topic Checkbox mysql query
Code:
Now - I want to pull those values into content type "Wheels"

I guess you want to pull
- ALL values of the field group
- for ALL existing items
into a new CHECKBOX field that will be assinged, (= appear) in the "Wheels" item form

ok, but the fieldgroup has many fields, do you want to use some field of the field group ? (this is my second guessing)


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...
The following user(s) said Thank You: iamrobert

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

More
8 years 6 months ago #56878 by iamrobert
Replied by iamrobert on topic Checkbox mysql query
Yes ggppdk - I want to pull:

Innovation Title
Brief
Image

into "wheels" and lay it out in a custom way.

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

More
8 years 6 months ago - 8 years 6 months ago #56946 by iamrobert
Replied by iamrobert on topic Checkbox mysql query
Here is the best I could come up with:
taichungdesigner.com/tt/index.php/wheels/road-wheels/t28

For sql1 ="": I can't show as the forum thinks I am SQL Injecting.
Code:
<?php function features($valueorder){ $foldern = JURI::base().'images/stories/flexicontent/item_33_field_61/l_'; $valueorder = explode(",",$valueorder); $db = JFactory::getDbo(); $query = $db->getQuery(true); foreach($valueorder as $order){ $sql1 = "" ; $db->setQuery($sql1); $results[] = $db->loadObjectList(); } $out =""; foreach($results as $result){ $src = unserialize($result[2]->value); $out .= '<p class="text-right"><span data-tooltip aria-haspopup="true" class="has-tip" title="'.$result[1]->value.'"><img src="'.$foldern.$src['originalname'].'" alt="'.$result[0]->value.'"></span></p>'; //print_r($src); } echo $out; } ?>

It seems to work ok - but I am sure the mysql could be better.
Last edit: 8 years 6 months ago by iamrobert.

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.339 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