Thanks Rocs!. I haven't done a var_dump (I pretty much really on the debugger). Here us one possibility:
foreach($results as $num => $row) What is $row? is that the number of rows? Isn't an array indexed from zero?
[0]='first'
[1]='second'
[2]='third'
So if $row returns 3 (in this case), $row[3] is pointing at a row that doesn't exist. I have never seen that foreach value ($row) used as an index. I guess the question is " in PHP, are array indexes zero based?". BTW I am using PHP 7.0. I see this note about foreach. What does it mean?
Quote:As [i]foreach[/i] relies on the internal array pointer in PHP 5, changing it within the loop may lead to unexpected behavior.
In PHP 7, [i]foreach[/i] does not use the internal array pointer.
I guess the question is what is $row assigned by
foreach($results as $num => $row) ? Is it a pointer like it would be in "C" as in &row, Or is it an integer? I am assuming that it will be an int, but I really don't know. The next line in the code it is used like this
$image_filename = $row->{$this->url_field};
Which makes me thinks that it is a pointer. Perhaps it should be used like this?
$current=$row(count) and then
$image_filename = $row[current].url_field};
proof that an old dog can learn new tricks