Re: HTML_TreeMenu, mysql, array and Tree.php from R. Heyes
| From: | Achim Altmann | Date: | Wed, 10 Nov 2004 00:16:43 +0000 |
| Subject: | Re: HTML_TreeMenu, mysql, array and Tree.php from R. Heyes | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-15411@lists.php.net to get a copy of this message | ||
Hello,
now i have tested new with this code
<?php
require_once("DB.php");
require_once("Tree/Tree.php");
$options = array('table'=>'Categories','whereAddOn'=>'SiteId=0','order'=>'CategoryId','columnNameMaps'=>array('id' => 'CategoryId','parentId' => 'CategoryParentId','name' => 'CategoryName'));
$tree = Tree::setupMemory('DBsimple', 'mysqli://mydb:mypass@unix(/tmp/mysqld-new.sock)/sell_by_web', $options);
$tree->setup();
include("HTML/TreeMenu.php");
$_treeMenu = HTML_TreeMenu::createFromStructure(array( 'structure'=>$tree,'type'=>'kriesing'));
$treeMenu = new HTML_TreeMenu_DHTML($_treeMenu, array('images' =>'imagesAlt2','defaultClass' => 'treeMenuDefault'));
?>
<html>
<head>
<style type="text/css">
.treeMenuDefault {
font-style: italic;
}
</style>
<script src="TreeMenu.js" language="JavaScript" type="text/javascript"></script>
</head>
<body>
<?$treeMenu->printMenu()?>
</body>
</html>
and comes this error
Warning: Invalid argument supplied for foreach() in /usr/local_2/lib/php/HTML/TreeMenu.php on line 137
i have no idea what is wrong :-(
Best regards
Achim