Welcome Guest, Not a member yet? Register   Sign In
[solved] Making a parentlist of id
#5

I now have tried this

PHP Code:
public function make_parent_list($fid) {

$sql "SELECT * FROM forum WHERE fid  = '" $fid "'"
     
      
$query 
$this->db->query($sql);

$arr = array();
     
      
foreach ($query->result() as $row) {

if (
$row->pid) {

$arr[] = $row->pid;

$arr[] = $this->make_parent_list($row->pid);

}
         
      
}

return 
$arr;



But the implode throws error here

Code:
A PHP Error was encountered
Severity: Warning
Message: implode(): Invalid arguments passed
Filename: forums/Forum_management.php

Echo out put is 34,Array


PHP Code:
$results $this->make_parent_list('36');

foreach (
$results as $result) {
echo 
implode(','$result);

There's only one rule - please don't tell anyone to go and read the manual.  Sometimes the manual just SUCKS!
Reply


Messages In This Thread
RE: Making a parentlist of id - by InsiteFX - 12-05-2016, 04:01 AM
RE: Making a parentlist of id - by wolfgang1983 - 12-05-2016, 04:16 AM
RE: Making a parentlist of id - by Wouter60 - 12-05-2016, 08:53 AM
RE: Making a parentlist of id - by wolfgang1983 - 12-05-2016, 08:53 PM
RE: Making a parentlist of id - by Paradinight - 12-05-2016, 09:27 PM
RE: Making a parentlist of id - by wolfgang1983 - 12-05-2016, 10:21 PM



Theme © iAndrew 2016 - Forum software by © MyBB