Welcome, Guest
Username: Password: Remember me
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
  • Page:
  • 1

TOPIC:

insert value in {joodb form} 3 weeks 2 days ago #6314

  • clibert
  • clibert's Avatar Topic Author
  • Offline
  • Posts: 3
  • Thank you received: 0
Hi,
how to insert value read from MySQL into {joodb form}?

Please Log in or Create an account to join the conversation.

insert value in {joodb form} 3 weeks 2 days ago #6318

  • Dirk
  • Dirk's Avatar
  • Offline
  • Posts: 1185
  • Karma: 21
  • Thank you received: 224
As you would do it in the normal single view template. With {joodb field|XXX}

{joodb field|title}
{joodb field|description}




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.
<?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 or Create an account to join the conversation.

insert value in {joodb form} 3 weeks 2 days ago #6319

  • clibert
  • clibert's Avatar Topic Author
  • Offline
  • Posts: 3
  • Thank you received: 0
ok - I insert {joodb form|field_name} and get empty input box.
Should I add something else?

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Moderators: Dirkjoest