'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

#2
[eluser]richzilla[/eluser]
and ive just realised 'bear with me'..... i must be getting tired...

#3
[eluser]Johan André[/eluser]
Maybe try to close the class with a }?

And leave out the closing php-tag. It's bad practice and it can cause you more damage than Chuck Norris...

#4
[eluser]richzilla[/eluser]
cheers, its always something little....


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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