Call to undefined function? Bollocks.
Posted: Tue Jul 21, 2009 3:30 pm
If anyone could help me debug this I would much appreciate it.
PHP is not my native tongue so I'm pretty sure my syntax might be muddled with C or FORTRAN or ADA or something.
When my script is interpreted I get this error:
Fatal error: Call to undefined function recursiveFindPath() in /net/koaserver/koadata2/*****/database.v1.inc on line 99
I've been staring at the code for about...oh, 13 hours straight now. I took out a few little syntactical ambiguities (my background is with C++ so I thought this would solve it) but to no avail. It would be nice if it was an obvious problem, don't be afraid to call me a f*ing idiot for missing it.
Here is the function call and the function in question.
The line that generates an error is in the call in findPath().
I've included the few lines that lead up to the end of the class as well:
***edit : I took out the comments for readability ***
PHP is not my native tongue so I'm pretty sure my syntax might be muddled with C or FORTRAN or ADA or something.
When my script is interpreted I get this error:
Fatal error: Call to undefined function recursiveFindPath() in /net/koaserver/koadata2/*****/database.v1.inc on line 99
I've been staring at the code for about...oh, 13 hours straight now. I took out a few little syntactical ambiguities (my background is with C++ so I thought this would solve it) but to no avail. It would be nice if it was an obvious problem, don't be afraid to call me a f*ing idiot for missing it.
Here is the function call and the function in question.
The line that generates an error is in the call in findPath().
I've included the few lines that lead up to the end of the class as well:
***edit : I took out the comments for readability ***
Code: Select all
function findPath($start, $goalfield)
{
$visited[$start] = TRUE;
//ERROR HERE
return recursiveFindPath($start, $nulllink, $visited, $goalfield);
//OMGHAXCWTF
}
function recursiveFindPath($current, $linkfield, $visited, $goalfield)
{
if(in_array($current, $this->links[$goalfield]))
return array($current, $linkfield);
else
{
foreach($this->adjacency[$current] as $next => $nextlink)
if(!$visited[$next] && $nextlink != $linkfield)
{
$visited[$next] = TRUE;
$path = recursiveFindPath($next, $nextlink, $visited, $goalfield);
if($path) return array_unshift($path, array($current, $linkfield));
}
return FALSE;
}
}
function doQuery($query)
{
return mysql_query($query, $this->db);
}
function dbClose()
{
mysql_close($this->db);
}
}
?>