If you expect answers you should describe your problem and give as much information's as possible. (SQL-Structure, Template Code, Joomla Version ...) Please read this before posting:
joodb.feenders.de/support.html
insert value in {joodb form}
- clibert
- Topic Author
- Offline
Less
More
- Posts: 3
- Thank you received: 0
4 years 9 months ago #6314
by clibert
insert value in {joodb form} was created by clibert
Hi,
how to insert value read from MySQL into {joodb form}?
how to insert value read from MySQL into {joodb form}?
Please Log in to join the conversation.
- d.hoeschen
-
- Offline
Less
More
- Posts: 1222
- Thank you received: 226
4 years 9 months ago #6318
by d.hoeschen
Replied by d.hoeschen on topic insert value in {joodb form}
As you would do it in the normal single view template. With {joodb field|XXX}
{joodb field|title}
{joodb field|description}
[hr]
But if you want to read data from another Table you must write a custom plugin.
Like This
Read value from another table and output form field with this value.
{joodb field|title}
{joodb field|description}
[hr]
But if you want to read data from another Table you must write a custom plugin.
Like This
Read value from another table and output form field with this value.
Code:
<?php
// no direct access
defined('_JEXEC') or die('Restricted access');
if (count($part->parameter)>=1) {
$db = JFactory::getDbo();
$field = $db->escape($part->parameter[0]);
if ($result = $db->setQuery("SELECT `".$field."` FROM #__YOURTABLE WHERE XXX = YYY")->loadResult()) {
$output .= '<input type="text" name="'.$field.'" value="'.htmlspecialchars(stripcslashes($result), ENT_COMPAT, 'UTF-8').'" />';
}
}
Please Log in to join the conversation.
- clibert
- Topic Author
- Offline
Less
More
- Posts: 3
- Thank you received: 0
4 years 9 months ago #6319
by clibert
Replied by clibert on topic insert value in {joodb form}
ok - I insert {joodb form|field_name} and get empty input box.
Should I add something else?
Should I add something else?
Please Log in to join the conversation.
Moderators: d.hoeschen, joest
