Welcome Guest, Not a member yet? Register   Sign In
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



Theme © iAndrew 2016 - Forum software by © MyBB