Welcome Guest, Not a member yet? Register   Sign In
'expecting t-function error' issues
#1

[eluser]richzilla[/eluser]
hi all, im in the middle of following a net tuts tutorial on the internet and all is going well until i start playing with data access. Basically one of my models is throwing the above error. I understand from google that contrary to what it says it is actually caused by too many semi colons rather than not enough but i really cant see ehat the probelm is. Yoll have to bear with me if the problems very simple, im very new to php...

my code is included below:

Code:
<?php
    class Data_model extends Model {
    
        function Data_model() {
            parent::model();
        }
        
        /*function getData() {
            $q = $this->db->query("SELECT * FROM data");
            if ($q->num_rows() > 0)
            {
                foreach ($q->result() as $row)
                {
                    $data[] = $row;
                }
                
                return $data;
            }
        }*/
        
        /*function getData() {
            $q = $this->db->get('data');
            
            if($q->num_rows() > 0)
            {
                foreach ($q->result() as $row)
                {
                    $data[] = $row;
                }
                
                return $data;
            }
        }*/
        
        function getData() {
            $this->db->select('title , contents');
            $q = $this->db->get('data');
            
            if($q->num_rows() > 0)
            {
                foreach ($q->result() as $row)
                {
                    $data[] = $row;
                }
                
                return $data;
            }
        }
?>

once again any help would be very appreciated.

thanks


Messages In This Thread
'expecting t-function error' issues - by El Forum - 08-10-2009, 03:52 PM
'expecting t-function error' issues - by El Forum - 08-10-2009, 03:55 PM
'expecting t-function error' issues - by El Forum - 08-10-2009, 03:57 PM
'expecting t-function error' issues - by El Forum - 08-10-2009, 04:00 PM



Theme © iAndrew 2016 - Forum software by © MyBB