dropdown-value as DBRead condition

gate 26 Mar, 2015
Hi folks,

I don't get any further...

I have three forms.
The first writes values through a few different fields to a database table. It works fine

the second and third are connected via multi-page.

the second consists of a dropdown, which gets its values via dynamical data from the stored values of the database table, it is meant to let an user choose which database entry to load into form 3. This also works perfectly fine, I can load all database entries into the dropdown.

form 3 consists of exact the same fields as form 1, but they are disabled, so you can only see the values, but not change them manually.
here is my problem, because I cant get the chosen dropdown value of form 2 work as a condition for my DB Read in form 3, the form fields are always filled with the values of the first database entry.

my custom code in the DBRead action looks like this

$user = JFactory::getUser();

$con=mysqli_connect("localhost", "root", "", "usr_web225_4");
// Check connection
if (mysqli_connect_errno())
{
echo "Error!: " . mysqli_connect_error();
}

$FormData = mysqli_query($con,"SELECT * FROM "joom_chronoengine_chronoforms_datatable_bedarfsanalyse" 
WHERE text7=".$form->data['Data0']['dropdown1']." ORDER BY id DESC LIMIT 1");

$line = mysqli_fetch_array($FormData);


I'm grateful for every useful hint
Max_admin 26 Mar, 2015
Answer
1 Likes
Hi gate,

v5 Conditions format should be like this:

<?php
return array("table_field_name" => $form->data("form_field_name"));


I hope this helps.

regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
gate 27 Mar, 2015
yaaaaaa..... why should use one line if you can use a hundred...

thanks Max worked perfectly at the first try *double thumbs up*
This topic is locked and no more replies can be posted.