Welcome Guest, Not a member yet? Register   Sign In
basic php problem.
#1

(This post was last modified: 05-24-2020, 02:33 AM by jreklund.)

I am not sure how this is supposed to work? $results is an array that gets loaded with a few records. I have looked for $row to be populated somewhere else in the code but it is not. My debugger runs down to the $image_filename. But $image_filename is null according to the debugger. I think that it should be the $row->URL_field, which is a string. 

PHP Code:
$results $this->ci->db->get($this->table_name)->result();

$thumbnail_url = !empty($this->thumbnail_path) ? $this->thumbnail_path $this->image_path;
  $final_results = array();
foreach(
$results as $num => $row)
{
  $image_filename $row->{$this->url_field};  //this is the field that should be populated with the URL string
if (empty($image_filename)) {
  continue;


Any idea why this is failing to get the string in the URL field? It seems to work normally, except if there is only one row.  What is the first row? $row or $row+1?
proof that an old dog can learn new tricks
Reply


Messages In This Thread
basic php problem. - by richb201 - 05-23-2020, 06:37 PM
RE: basic php problem. - by php_rocs - 05-24-2020, 02:54 AM
RE: basic php problem. - by richb201 - 05-24-2020, 08:23 AM
RE: basic php problem. - by InsiteFX - 05-24-2020, 08:50 AM
RE: basic php problem. - by richb201 - 05-24-2020, 09:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB