Welcome Guest, Not a member yet? Register   Sign In
How to build menu with single query?
#5

[eluser]Zorancho[/eluser]
Yes it's a good practice to use recursive function and build an array with all the relationships.
Check out the CI code is using lots of recursive functions such as:
Code:
function escape_str($str)
{
   if(is_array($str))
   {
      foreach($str as $key => $val)
      {
         $str[$key] = escape_str($val);
      }
      return $str;
   }
   else
   {
      return mysql_real_escape_string($str);
   }
}


Messages In This Thread
How to build menu with single query? - by El Forum - 02-14-2010, 03:59 AM
How to build menu with single query? - by El Forum - 02-14-2010, 04:40 AM
How to build menu with single query? - by El Forum - 02-14-2010, 04:41 AM
How to build menu with single query? - by El Forum - 02-14-2010, 05:03 AM
How to build menu with single query? - by El Forum - 02-14-2010, 05:25 AM
How to build menu with single query? - by El Forum - 02-14-2010, 05:35 AM
How to build menu with single query? - by El Forum - 02-14-2010, 08:20 AM
How to build menu with single query? - by El Forum - 02-14-2010, 08:27 AM



Theme © iAndrew 2016 - Forum software by © MyBB