• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Only getting first letter of each row :/


Im having a small problem with some code I've written, for some reason when I do my foreach loop in the view, im only getting the first letter displaying of each row, and applying the foreach to the columns not the rows.

All very odd, heres the code extract:

$get_licences = $this->db->query("SELECT *  FROM `vk_licences` WHERE `gid` = '" . $gid . "'");
This is the the go get from DB bit

$member = array(
'licence' => $get_licences->row_array()
I add the row_array() into my view array

&lt;?php foreach($licence as $item):?&gt;
<tr class="odd">
<td>&lt;?php echo $item['wkgb']; ?&gt;</td>
<td>&lt;?php echo $item['expiry']; ?&gt;</td>
&lt;?php endforeach ?&gt;
The bit in the loop

Any help appreciated!

[eluser]Phil Sturgeon[/eluser]
Use result_array() instead. You cant foreach a 1 dimensional array.

Wow, I just made a idiot out of myself!

Nice Spot!

[eluser]Phil Sturgeon[/eluser]
Happens to us all. Run out of mountain dew/red bull/whiskey/etc? Wouldnt be the first time :p

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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