getbyfunction warning
Brought to you by:
jpap
call $db->getbyfunction("my_filter", "name");
if the result set is empty, a warning is generated
Notice: Undefined variable: sresult in ffdb.inc.php on
line 2464
I modifed
function order_by(&$result, $orderby)
{
$record_count = count($result);
if ($record_count == 0)
return $result;
....
to have the check for record_count == 0
Logged In: YES
user_id=1196724
Don't you mean "if($record_count != 0)"? That way it will
only return if it has records.
Logged In: NO
A better fix perhaps would be to initialize $result to an empty array inside of getbyfunction() before the for loop:
// Read each record and add it to an array
$rcount = 0;
$result = array(); // THIS LINE ADDED
foreach($index as $offset)