简体   繁体   中英

unable to retrieve data from respective table zf2

While using this, this will gives an resultset object successfully

$goals = $this->getGoalTable()->listgoal($userid);
$goals->current();
return new ViewModel(array(
'paginator' => $goals,
));

but while retrieving this, i am getting blank! no data and no errors also

<?php foreach($paginator as $row){ ?>
    <?php print_r($row);    // this is giving its own model's data of controller but not my goal tables data  ?>
       <?php echo $this->escapeHtml($row->name);   // getting blank values here  ?>
       <?php echo $this->escapeHtml($row->coach_email);  // getting blank values here ?>
<?php } ?>

Try this in controller itself -

$goals = $this->getGoalTable()->listgoal($userid);
$goals->current();

print_r($goals); //Its an object with single array.
exit();

and check if you get any values.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM