Insert in Dropdown data from table by ID user
Hello,
I'm developing a form with a external database. The primary key is id ,but we have another field, fio
How i can view in dropdown data from table, colume name fio by user ID?
Than i insert custom code i view this code how text in my form from site
I insert this code on DB Read on found in custom code. In Dropdown, dynamyc data Path data = ID model BD read
May be i can make it by standart option....
On screen my options
Thanks a lot.
I'm developing a form with a external database. The primary key is id ,but we have another field, fio
How i can view in dropdown data from table, colume name fio by user ID?
Than i insert custom code i view this code how text in my form from site
<?php
$form = JFactory::getDbo();
$user = JFactory::getUser();
$query = $db->getQuery(true);
$query= 'SELECT * FROM #__sotrudniki WHERE id='. $user->get("id");
$form->setQuery($query);
$form->query();
?>
I insert this code on DB Read on found in custom code. In Dropdown, dynamyc data Path data = ID model BD read
May be i can make it by standart option....
On screen my options
Thanks a lot.
Hi,
In the "conditions" box of the "db read" you should use the following code to return the table rows of the logged in user's id:
Please clear the "Fields" box.
Then you can use "fio" in the "text" and "value" boxes of your dropdown "Dynamic data" tab!
Regards,
Max
In the "conditions" box of the "db read" you should use the following code to return the table rows of the logged in user's id:
<?php
$user = JFactory::getUser();
return array("user_id" => $user->id);
Please clear the "Fields" box.
Then you can use "fio" in the "text" and "value" boxes of your dropdown "Dynamic data" tab!
Regards,
Max
But i have problem . Code in contidion dont work. See me how text
[URL=http://www.radikal.ru][IMG]http://s51.radikal.ru/i131/1412/23/87af4654d939.png[/IMG][/URL]
[URL=http://radikal.ru/fp/d2e71ca93f694235931644ad8bd33969][IMG]http://s020.radikal.ru/i700/1412/89/17f7802dc4f4t.jpg[/IMG][/URL]
[URL=http://www.radikal.ru][IMG]http://s51.radikal.ru/i131/1412/23/87af4654d939.png[/IMG][/URL]
[URL=http://radikal.ru/fp/d2e71ca93f694235931644ad8bd33969][IMG]http://s020.radikal.ru/i700/1412/89/17f7802dc4f4t.jpg[/IMG][/URL]
Now i have this problem. Need help. Max I insert code in condition db read, clear feald
Patams at dropdown in my first screen
[URL=http://www.radikal.ru][IMG]http://s017.radikal.ru/i404/1412/be/74466feb4255.png[/IMG][/URL]
Patams at dropdown in my first screen
[URL=http://www.radikal.ru][IMG]http://s017.radikal.ru/i404/1412/be/74466feb4255.png[/IMG][/URL]
Plz help. I see code from condition bd read how tex, but this code is work. How delete this code-text over code
But i have problem .. See me how text
[URL=http://www.radikal.ru][IMG]http://s51.radikal.ru/i131/1412/23/87af4654d939.png[/IMG][/URL]
[/URL]
Its because you have a space in the PHP start tag, it should be <?php
Sorry for the late answer!
Regards,
Max
Sorry for the late answer!
Regards,
Max
This topic is locked and no more replies can be posted.