【发布时间】:2013-04-25 05:49:45
【问题描述】:
我有一个问题,我正在安装组件,我想在后端添加一个新字段,我想在后端添加一个新字段,该字段是我想添加的下拉列表和我想从下拉列表中的数据库中获取数据
给我任何建议以解决我的问题,然后告诉我在组件中在哪里编写 dat 查询告诉我具体的文件名我有代码,我添加如下代码
试图在 84 行的 C:\wamp\www\Joomla\administrator\components\com_home_service\views\serviceitem\tmpl\edit.php 中获取非对象的属性 84
<form action="<?php echo JRoute::_('index.php?option=com_home_service&layout=edit&id=' . (int) $this->item->id); ?>" method="post" enctype="multipart/form-data" name="adminForm" id="serviceitem-form" class="form-validate">
<div class="width-60 fltlft">
<fieldset class="adminform">
<legend><?php echo JText::_('COM_HOME_SERVICE_LEGEND_SERVICEITEM'); ?></legend>
<ul class="adminformlist">
<li><?php echo $this->form->getLabel('id'); ?>
<?php echo $this->form->getInput('id'); ?></li>
<li><?php echo $this->form->getLabel('image'); ?>
<?php echo $this->form->getInput('image'); ?></li>
<li><?php echo $this->form->getLabel('image_name'); ?>
<?php echo $this->form->getInput('image_name'); ?></li>
<?php
//defined('_JEXEC') or die('Restricted access');
$db = JFactory::getDBO();
$query=$db->getQuery (true);
$query->SELECT ('*');
$query->from('#__content');
$db->setQuery( $query);
$results = $db->loadObjectList();?>
<li><?php echo $this->form->getLabel('image_name'); ?>
<select>
<option value="<?php echo $result->id; ?>">1</option>
</select></li>
</ul>
</fieldset>
</div>
给我这个问题的线索
我想在下拉列表中提取其他表数据并告诉我正确的查询..
【问题讨论】:
标签: phpmyadmin components joomla2.5