[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