Welcome Guest, Not a member yet? Register   Sign In
[Solved] Active Records DB Model
#4

(03-16-2015, 07:46 AM)CroNiX Wrote: The problem would be addressed in the view, where you are using the data, not in the model.

it would be something like:

PHP Code:
<?php if(count($data)): //check to see if there ARE users returned ?>
<?foreach($data as $d): //yes, list them ?>
<div><?=$d['name']; ?></div>
<?php endforeach; ?>
<?php 
else: //no, display message ?>
<p>Sorry, no users matching criteria.</p>
<?php endif; ?>

All solved now I had to tinker with my model and view and controller all good now.
There's only one rule - please don't tell anyone to go and read the manual.  Sometimes the manual just SUCKS!
Reply


Messages In This Thread
RE: Active Records DB Model - by CroNiX - 03-16-2015, 07:46 AM
RE: Active Records DB Model - by wolfgang1983 - 03-16-2015, 04:09 PM
RE: [Solved] Active Records DB Model - by wolfgang1983 - 03-16-2015, 09:50 PM



Theme © iAndrew 2016 - Forum software by © MyBB