Welcome Guest, Not a member yet? Register   Sign In
help on how to loop .. displaying all data on database..
#4

[eluser]besingamk[/eluser]
[quote author="Rowan Wilson" date="1357559740"]Something like this:

Code:
<?php if ($result): ?>

<?php foreach ($result as $row): ?>

<div class="eight columns">
<div class="row">
  <div class="four mobile-two columns">
   <img src="&lt;?php echo base_url(); ?&gt;/images/templates/&lt;?php $row-&gt;image; ?&gt;" alt="Simple and Clean Template">
   <div class="panel">
    <h5>&lt;?php echo $row->name; ?&gt;</h5>
    <h6 class="subheader">&lt;?php $row->type; ?&gt;<span class="right"><a href="templates/fresh-and-clean.php">Detail</a></span></h6>
   </div>
  </div>
</div>
</div>

&lt;?php endforeach; ?&gt;

&lt;?php else: ?&gt;

<p>No result found</p>

&lt;?php endif; ?&gt;
[/quote]

sir how about if i want 5 items only to be display.. ??


Messages In This Thread
help on how to loop .. displaying all data on database.. - by El Forum - 01-07-2013, 06:04 AM



Theme © iAndrew 2016 - Forum software by © MyBB