Buy Now
Sign in

Populate Dropdown Menue from MySQL Database

QuimiQ , March 15 at 03:26
Q
QuimiQ 13
March 15 at 03:26 #384868
Ok so this has quickly become one of the most frustrating thing's I have had to deal with in a long time. What I want to do is very simple. I have a table in my database with a bunch of teams in them and I simply want to have a drop down from which I can chose one of those teams. That should be a piece of cake. Unfortunately the only "Tutorial" I found on this is this link right here: https://www.chronoengine.com/faqs/74-chronoforms6/5287-dynamic-dropdown-options.html which was linked in a forum post. Now how this fine gentleman was able to work with this meager tutorial is a mystery to me. I guess I'm just too fucking stupid. But honestly a few pictures or maybe an example would help.
Step one was easy enough after I figured out what was meant by "Setup Section". Step two was a bit more tricky because there are a shit ton of fields that pop up and none of them are mentioned here. So it took a while to figure out what was what and where on top of that there is this piece of information:
"and in the "Fields to retrieve" add the two field names you want to use for the dropdown options values and labels respectively."
what do you want me to do? what field names? I don't get it! Are you asking me for the column in the database? Are you asking me for what dropdown I want to use this in? Why two? I'm sorry but I have no Idea what they are talking about here. Now for step 3. Holy fuck just put a fucking picture there. It took me forever to find that!!!
Now I'm really sorry but the lack of information and documentation got me quite frustrated as I was trying to figure this stuff out for myself but I simply gave up.
If someone has an example I can look at or a propper tutorial that would be great.
GreyHead 63.4
March 15 at 10:41 #384871
Hi QuimiQ ,
You are correct - 'Fields to retrieve' does refer to the column names in the database table. There are two because you are getting the data so set the 'value' and 'text' for each of the drop-down options - I guess that would probably be the record ID as the value and the Team Name asn the text.
Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
Q
QuimiQ 13
March 15 at 16:17 #384877
Thx that's explains things a bit. However I found out that for some reason most the "database connection failed" I have different db users and when I enter the credentials of one of them, save and reopen the form I can see and select my table. But if I try to set everything up and then save, close and reopen it says "Database connection failed". Despite me not having changed anything about these settings.
I also don't know how to input the two fields. is it:
team_short=team_name
team_short team_name
team_short, team_name
team_short
team_name
again an example would have gone a long way but maybe someone here knows.
healyhatman 5.7
March 16 at 04:37 #384895
team_short
team_name
Web developer at SkySpider.com.au
I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman

You can now copy+paste code from forums
GreyHead 63.4
March 16 at 10:42 #384898
Hi QuimiQ ,
. . . and the "Database connection failed" problem sounds to be something about your server setup. You do not normally need to enter a db username in ChronoForms unless you are connecting to an external database.
Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
Q
QuimiQ 13
March 17 at 05:55 #384926
 Answer
It works now and I just wanted to explain what I did so anyone finding this via google can profit off of this.

First off, I was working with an external Database.
And here is my Solution: I switched to Form Maker for Joomla. It's much better documented and I didn't even need the documentation it's that intuitive. Very simple to use and it worked first try.