Hi Peter,
Could you please help me here.
I'm trying to populate a select list with content that I retrieve from database #__categories.
I have this piece of code that is in "Before Form" option of my form.
// load the standard form creation utilities
$this->execPieceByName('ff_InitLib');
//set globals
global $record;
//set value of id
$rid = ff_getParam('ff_param_rid');
//load existing data
global $record;
//query db
$rows = ff_select("select `title` from `#__categories` where published=1");
$categorie="1;Veuillez choisir un;\n";
if (Count($rows))
{
foreach($rows as $record)
{
$categorie.="0;$record->title; $record->title\n";
}
}
In my "Select List" Categorie, in "Advanced" tab then "Initscript" I selected "Custom" and have put this code
<?php
global $categorie;
return $categorie;
?>
Whoever in my form my "Categorie" select list is empty. Do you know what is not working in what I'm doing? I'm not even sure what I'm doing is the right way.
Thank you very much in advance for your help.
Helio