<?xml version="1.0"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>MachForm Community Forums Topic: drop downs and MySQL</title>
<link>https://www.machform.com/forums/</link>
<description>MachForm Community Forums Topic: drop downs and MySQL</description>
<language>en</language>
<pubDate>Wed, 06 May 2026 02:13:49 +0000</pubDate>

<item>
<title>Molina on "[closed] drop downs and MySQL"</title>
<link>https://www.machform.com/forums/topic/drop-downs-and-mysql#post-1417</link>
<pubDate>Sat, 19 Apr 2008 16:39:34 +0000</pubDate>
<dc:creator>Molina</dc:creator>
<guid isPermaLink="false">1417@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;:-) Great!&#60;br /&#62;
Thanks, how easy things can be...
&#60;/p&#62;</description>
</item>
<item>
<title>yuniar on "[closed] drop downs and MySQL"</title>
<link>https://www.machform.com/forums/topic/drop-downs-and-mysql#post-1408</link>
<pubDate>Sat, 19 Apr 2008 07:33:46 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">1408@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Oops..you are right. I forgot that checkboxes only have Yes (1) or No (0) values.&#60;/p&#62;
&#60;p&#62;A little adjustment is needed to your query. Try this:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;SELECT
A.*,
B.option AS element_2_1_value,
C.option AS element_2_2_value
FROM
(ap_form_28 AS A
LEFT JOIN ap_element_options AS B
ON A.element_2_1=1 AND B.element_id=2 AND B.option_id=1 and B.form_id=28)
LEFT JOIN ap_element_options AS C
ON A.element_2_2=1 AND C.element_id=2 AND C.option_id=2 and C.form_id=28&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;&#60;code&#62;&#60;/code&#62;
&#60;/p&#62;</description>
</item>
<item>
<title>Molina on "[closed] drop downs and MySQL"</title>
<link>https://www.machform.com/forums/topic/drop-downs-and-mysql#post-1400</link>
<pubDate>Fri, 18 Apr 2008 18:48:50 +0000</pubDate>
<dc:creator>Molina</dc:creator>
<guid isPermaLink="false">1400@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;I've got 2 checkboxes, for example (I hope it's understandable):&#60;br /&#62;
checkbox 1 = element_id 2, option_id 1, option = &#34;first V&#34;&#60;br /&#62;
checkbox 2 = element_id 2, option_id 2, option = &#34;second V&#34;&#60;br /&#62;
The query&#60;/p&#62;
&#60;p&#62;SELECT&#60;br /&#62;
A.*,&#60;br /&#62;
B.option AS element_2_1_value,&#60;br /&#62;
C.option AS element_2_2_value&#60;br /&#62;
FROM&#60;br /&#62;
(ap_form_28 AS A&#60;br /&#62;
LEFT JOIN ap_element_options AS B&#60;br /&#62;
ON A.element_2_1=B.option_id AND B.element_id=2 AND B.form_id=28)&#60;br /&#62;
LEFT JOIN ap_element_options AS C&#60;br /&#62;
ON A.element_2_2=C.option_id AND C.element_id=2 AND C.form_id=28&#60;/p&#62;
&#60;p&#62;is working correctly for the first element.&#60;br /&#62;
But the second choice alway returns the value of the first one; it inserts &#34;1&#34; into the database as you can see in the source code of the html-page:&#60;br /&#62;
&#38;lt;input id=&#34;element_2_2&#34; name=&#34;element_2_2&#34; class=&#34;element checkbox&#34; type=&#34;checkbox&#34; value=&#34;1&#34; /&#38;gt;.&#60;br /&#62;
If I want to output the value &#34;second V&#34; written in ap_element_options of the second checkbox too I have to change the datatabase in ap_form_28  from &#34;1&#34; to &#34;2&#34;, then the output is what I'd like to get: &#34;second V&#34;.&#60;br /&#62;
Is there something wrong?&#60;br /&#62;
Or is there normally only a Yes- or No-option?&#60;br /&#62;
Thanks again for help!&#60;br /&#62;
Molina
&#60;/p&#62;</description>
</item>
<item>
<title>yuniar on "[closed] drop downs and MySQL"</title>
<link>https://www.machform.com/forums/topic/drop-downs-and-mysql#post-1398</link>
<pubDate>Fri, 18 Apr 2008 13:45:30 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">1398@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Molina, the query would be exactly the same as dropdowns.&#60;br /&#62;
Checkboxes and dropdowns are treated similar.&#60;/p&#62;
&#60;p&#62;Post your query here if you can't seem to make it work.&#60;br /&#62;
I'll try to help.
&#60;/p&#62;</description>
</item>
<item>
<title>Molina on "[closed] drop downs and MySQL"</title>
<link>https://www.machform.com/forums/topic/drop-downs-and-mysql#post-1393</link>
<pubDate>Fri, 18 Apr 2008 13:03:36 +0000</pubDate>
<dc:creator>Molina</dc:creator>
<guid isPermaLink="false">1393@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;Yuniar, how can I extract the values for checkboxes via MySQL in a query? Would you please help me again?&#60;br /&#62;
Thanks&#60;br /&#62;
Molina
&#60;/p&#62;</description>
</item>
<item>
<title>yuniar on "[closed] drop downs and MySQL"</title>
<link>https://www.machform.com/forums/topic/drop-downs-and-mysql#post-1372</link>
<pubDate>Thu, 17 Apr 2008 07:03:04 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">1372@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;You will be able to create forms which connect to your mysql database. all submission will be stored on your database.
&#60;/p&#62;</description>
</item>
<item>
<title>expat on "[closed] drop downs and MySQL"</title>
<link>https://www.machform.com/forums/topic/drop-downs-and-mysql#post-1362</link>
<pubDate>Wed, 16 Apr 2008 17:49:44 +0000</pubDate>
<dc:creator>expat</dc:creator>
<guid isPermaLink="false">1362@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;i thought in another post the admin says you can populate a drop down list???&#60;/p&#62;
&#60;p&#62;So with this you can actually generate a php form that connects to the Mysql??
&#60;/p&#62;</description>
</item>
<item>
<title>Molina on "[closed] drop downs and MySQL"</title>
<link>https://www.machform.com/forums/topic/drop-downs-and-mysql#post-1337</link>
<pubDate>Fri, 11 Apr 2008 22:40:37 +0000</pubDate>
<dc:creator>Molina</dc:creator>
<guid isPermaLink="false">1337@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Yuniar, you're great!&#60;br /&#62;
Thanks a lot, it works fine and I learned a little bit more :-)&#60;br /&#62;
Maybe I will have to ask another question...&#60;/p&#62;
&#60;p&#62;Molina
&#60;/p&#62;</description>
</item>
<item>
<title>yuniar on "[closed] drop downs and MySQL"</title>
<link>https://www.machform.com/forums/topic/drop-downs-and-mysql#post-1332</link>
<pubDate>Fri, 11 Apr 2008 06:47:57 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">1332@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;This forum can't display backtick properly. So if the above query give you an error, try to copy this one: &#60;a href=&#34;http://mf.pastebin.com/f7fcdbcc2&#34; rel=&#34;nofollow&#34;&#62;http://mf.pastebin.com/f7fcdbcc2&#60;/a&#62;
&#60;/p&#62;</description>
</item>
<item>
<title>yuniar on "[closed] drop downs and MySQL"</title>
<link>https://www.machform.com/forums/topic/drop-downs-and-mysql#post-1331</link>
<pubDate>Fri, 11 Apr 2008 06:45:10 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">1331@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hi Molina,&#60;/p&#62;
&#60;p&#62;Actually, those A and B are just alias for those tables.&#60;br /&#62;
In your case, the query would be more complex, since you have two dropdowns.&#60;/p&#62;
&#60;p&#62;Ok, let say you have table  &#60;strong&#62;ap_form_271&#60;/strong&#62;&#60;br /&#62;
element_1 to element_5 are textfields and element_6 and element_7 are dropdowns.&#60;/p&#62;
&#60;p&#62;Your query would be like this:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;select
      A.*,
      B.option as element_6_value,
      C.option as element_7_value
  from
      (ap_form_271 as A
       left join ap_element_options as B
              on A.element_6=B.option_id and B.element_id=6 and B.form_id = 271)
       left join ap_element_options as C
              on A.element_7=C.option_id and C.element_id=7 and C.form_id=271&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;&#60;code&#62;&#60;/code&#62;&#60;br /&#62;
So it uses two joins. One to get the value of your first dropdown and second for the other one. A, B and C are just table alias, so you can use it as is.&#60;br /&#62;
You only need to change the &#60;strong&#62;271&#60;/strong&#62; values.
&#60;/p&#62;</description>
</item>
<item>
<title>Molina on "[closed] drop downs and MySQL"</title>
<link>https://www.machform.com/forums/topic/drop-downs-and-mysql#post-1325</link>
<pubDate>Thu, 10 Apr 2008 14:45:19 +0000</pubDate>
<dc:creator>Molina</dc:creator>
<guid isPermaLink="false">1325@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hi Yuniar,&#60;/p&#62;
&#60;p&#62;I bought your software one week ago and I like it a lot, it's easy to use and the forms look very well! Now I'd like to read the data to show them on a webpage and I got a problem that has to do with the drop downs and multiple choices. How can I output them?&#60;br /&#62;
5 months ago, grg had a similar problem (forum topic: Mysql Question) and you answered, that one has to join the 2 tables, ap_form_XX and ap_element_options. This is basically clear; in your sample you wrote:&#60;/p&#62;
&#60;p&#62;select&#60;br /&#62;
      A.*,B.option&#60;br /&#62;
from&#60;br /&#62;
      ap_form_99 A left join ap_element_options B&#60;br /&#62;
on&#60;br /&#62;
      A.element_2=B.option_id and B.element_id=2&#60;br /&#62;
where&#60;br /&#62;
      B.form_id=99&#60;/p&#62;
&#60;p&#62;but what is &#34;select A.*, B.option&#34;?&#60;br /&#62;
Let's say I got some elements_1 to elements_5 as textfields, numbers or whatever, which are working very well, and element_6, element_7 in ap_form_XX as drop downs and option_id and option in ap_element_options - but no A and B, for sure ;-)&#60;br /&#62;
I'm not very experienced in MySQL, so at the moment I don't have a clue, please give me hint! What do I have to write in the lines SELECT and FROM?&#60;/p&#62;
&#60;p&#62;Much thanks in advance&#60;br /&#62;
Molina
&#60;/p&#62;</description>
</item>

</channel>
</rss>
