Hi,
I have a php file (A) that instance a class from another php file (😎.
I need use a recursive function with a method from that class, but an error happen. I think the instance in the begin of my file A doesn't work within a function from itself. Why it happens? I have to instance again the classe in the recursive function ?
Bellow is the code (some):
<?php
require("class.php");
//conect is the constructor function in the class
$instance = new conect();
function mapa($COD=1){
if ($instance->query("SOME SELECT)")){
while ($array = ibase_fetch_row($instance->result)){
mapa($array[1]);
}
echo("$array[1]");
}
}
mapa();
?>