Subject | RE: [firebird-php] Re: PDO |
---|---|
Author | Alan McDonald |
Post date | 2005-06-24T23:54:13Z |
> Ok got PHP_intebase working and am now working on generating awhy $$branch? - 2 $ signs
> html_TreeMenu from a database query.
>
> I'm using HTML_TreeMenu and loopping through my results but i keep
> getting this message "Call to a member function addItem() on a
> non-object". I have done hardly any OOP but I think the problem is
> somewhere in the this code:
>
> while($row = ibase_fetch_object($result)) {
> //print_r($Result);
> echo $row->Name .'<br>';
> echo 'Parent, '.$row->ParentId .'<br>';
> echo $row->ID .'<br>';
> // populate variables from db...
> $branch=$row->ID;
> $branch_parent = $row->ParentId;
> $branch_value = $row->Name;
> echo 'branch, '.$branch;
> /*
> $branch = $db->f("ID");
> $branch_parent = $db->f("ParentId");
> $branch_value = $db->f("Name");*/
>
> // Build tree...
> if($branch_parent) {
> $$branch_parent=$branch_parent;
> $$branch = &$$branch_parent->addItem(new
> HTML_TreeNode(array('text'
> => $branch, 'link' => $branch_value, 'icon' => $icon, 'expandedIcon'
> => $expandedIcon)));
> } else {
> $$branch = new HTML_TreeNode(array('text'
> => $branch, 'link' =>
> $branch_value, 'icon' => $icon, 'expandedIcon' => $expandedIcon));
> $tree[$i++] = &$$branch; // Indexed
> reference for final tree
> consruction.
> }
> //unset($branch);
> //unset($branch_parent);
> //unset($branch_value);
>
> //$Result = $db->next_record();
> } //wend
>
> thanks for all the help, some time even the smallest comments just
> seem to make things click.
> Darren
>
Alan