Hobke - 2012-04-11 10:33:03
Hello All,
Hope someone can help me with this one ...
I would like to us the result of one function as parameter to another funtion.
This is the class info:
class portalContent
{
var $portalQuickLinks;
var $portalQuickCategories;
public function getPortalQuickCategories ($siteLang)
{
// does stuff here
$this->portalQuickCategories = mysql_query("SELECT ...");
return $this->portalQuickCategories !== false;
}
public function getPortalQuickLinks ($siteLang, $quickCategory)
{
//does stuff here
$this->portalQuickLinks = mysql_query("SELECT ...");
return $this->portalQuickLinks !== false;
}
public function displayPortalQuickLinks ($siteLang)
{
echo "step1 - "; //debugging
if($this->getPortalQuickCategories($siteLang)==true)
{
echo "step2 - "; //debugging
while ($row_c = mysql_fetch_object($this->portalQuickCategories))
{
echo "step3 - "; //debugging
$this->getPortalQuickLinks($siteLang, $row_c->QUICK_TITLE);
echo "<div id=\"footerMS\">";
echo "<h2>"; print_r ($row_c->QUICK_TITLE); echo "</h2><ul>";
if ($this->getPortalQuickLinks($siteLang, $row_c->QUICK_TITLE)==true)
{
while ($row_l = mysql_fetch_object($this->portalQuickLinks))
{
echo "step4 - "; //debugging
echo "<li><a href=\"##\"> "; print_r($row_l->QUICK_ITEM); echo "</a></li>";
}
echo "</ul></div>";
}
else
{
echo "oops no elements found";
}
}
}
else
{
echo "oops no footer found";
}
}
}
Then in the php page I include the class and us it as follows:
<?php
$myQuickFooter = new portalContent();
$myQuickFooter->displayPortalQuickLinks($siteLang);
?>
Output is now "step1 - step2 - "
Not sure how I can get the result from the first function (a set of categories) to be inserted as parameter to the second function to get the set of links according to the category.
The queries do give me the results needed. That has been tested via phpMyAdmin console.
Must be something wrong in my class definition ?
Regards,
Hob.