Welcome Guest, Not a member yet? Register   Sign In
foreach statement is giving syntax error
#6

(08-01-2016, 11:44 PM)dilipan Wrote:
(08-01-2016, 09:58 PM)waptik Wrote: try this:

<?php foreach ($records as $rows):?>
      <?php echo $rows->firstname; ?>
<?php endforeach; ?>

waptik  It did work well. I learnrd, that i did a syntax error by putting ; instead of : at the end of the foreach statement. Appreciate it and God Bless.


You are welcome bro. But next time, kindly use this
Code:
foreach(condition){
// what you want to achieve
}
 statement which is pretty clear unlike the one you used which can sometimes be confusing.
Be Simple Angel
Reply


Messages In This Thread
RE: foreach statement is giving syntax error - by waptik - 08-02-2016, 08:51 AM



Theme © iAndrew 2016 - Forum software by © MyBB