PHP code for Joomla 1.5

Locked
jaydsullivan
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Mon Aug 11, 2008 10:43 pm

PHP code for Joomla 1.5

Post by jaydsullivan » Mon Aug 11, 2008 11:03 pm

Hello to everyone.

I am rewritting our School Intranet to use Joomla 1.5. I am also writting some components that we had on the old intranet (written in aspx/vb).

Heres my issue:
two tables table one studentid, studentname, table two classid, classname, studentname. In the admin (scclass school classes) section I want to be able to add classes and from a listbox select a student.


I have brought the book 'learning Joomla! 1.5 extension development' which has been very helpful until now.

using a drop down list box this code works fine:
$scclasses = array(
'0' => array('value' => 'None Taken', 'text' => 'None Taken')
,'1' => array('value' => '01/01', 'text' => '01/01'),);

now when I use dreamweaver MX with this code:
$i=0;
$scclasses;
while($rows = mysql_fetch_array($result, MYSQL_ASSOC))
{
$scclasses[$i] = array('value' => "{$rows['bname']}", 'text' => "{$rows['bname']}");
$i++;
}

The array appears the same but when I use it in Joomla it fails.

$lists['scclasses'] = JHTML::_('select.genericList', $scclasses, 'scclasses', 'class="inputbox" '. '', 'value', 'text', $row->scclasses);

Jay.d.sullivan
ICT Technician
The Warriner School

Locked

Return to “Joombie Tools of the Trade”