• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Model problems

#1
[eluser]PrivateSniper[/eluser]
Ok despite all my efforts this particular code is starting to bug me, i've been following a tutorial, and I just cannot understand why this is not working, the error is showing as:

Quote:Parse error: syntax error, unexpected T_RETURN, expecting ')' in /model.php on line 15
(i have amended the url on this error message to hide my full path, can anyone please advise on why return is not working?

Code:
<?php
class Model extends CI_Model {

function __construct() {
parent::__construct();
}

function get(){
  $q = $this->db->get('table');

  foreach ($q->result() as $row {
    $data[] = $row
   }
  return $data->result();
  }
}
?>


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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