• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to select all or get all the data in a table?

#3
[eluser]skunkbad[/eluser]
In the view, the way you wrote the foreach is probably wrong. mr_prasanna was right. I was going to suggest you try:

Code:
<?php
foreach( $results as $row )
{
     echo '
          <h2>' . $row['id'] . '</h2>
          <h3>' . $row['Name'] . '</h3>
     ';
}

Even though you are using alternative syntax for your foreach, you have left out the colon(Smile, so I'm not sure it's going to work. Personally, I don't like the alternative syntax, and think you should use standard syntax because alternative syntax is cluttered.


Messages In This Thread
How to select all or get all the data in a table? - by El Forum - 07-15-2012, 07:56 AM
How to select all or get all the data in a table? - by El Forum - 07-15-2012, 08:11 AM
How to select all or get all the data in a table? - by El Forum - 07-15-2012, 08:16 AM
How to select all or get all the data in a table? - by El Forum - 07-15-2012, 08:39 AM
How to select all or get all the data in a table? - by El Forum - 07-15-2012, 08:43 AM
How to select all or get all the data in a table? - by El Forum - 07-15-2012, 09:00 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.