Welcome Guest, Not a member yet? Register   Sign In
From Database to Array
#11

[eluser]jcavard[/eluser]
[quote author="georgerobbo" date="1249953303"]I get:

Parse error: syntax error, unexpected ';', expecting T_FUNCTION in /var/www/system/application/models/ros_sidecont.php on line 19[/quote]
well, it'd be interesting to have the code at that line 19 of ros_sidecont.php. copy/paste the whole code
#12

[eluser]georgerobbo[/eluser]
It is just a line break, without it the error returns Line 18. All my code is pasted above. I updated it.
#13

[eluser]jcavard[/eluser]
well, if your code is exact as the following:
Code:
class Ros_sidebar extends Model {

    function Ros_sidebar()
    {
        parent::Model();
    }
    
    function get_sideitem()
    {
        $query = $this->db->query('SELECT title, text FROM ros_sidebar');
        $data = array(); // CHANGED THIS LINE
        foreach($query->result_array() as $row)
        {
             $data[] = $row; // CHANGED THIS LINE
        }
}
There is a missing closing bracket at the end
Code:
class Ros_sidebar extends Model {

    function Ros_sidebar()
    {
        parent::Model();
    }
    
    function get_sideitem()
    {
        $query = $this->db->query('SELECT title, text FROM ros_sidebar');
        $data = array(); // CHANGED THIS LINE
        foreach($query->result_array() as $row)
        {
             $data[] = $row; // CHANGED THIS LINE
        }
    } // THIS ONE!!
}
#14

[eluser]georgerobbo[/eluser]
All that trouble over a closing tag.
#15

[eluser]jcavard[/eluser]
[quote author="georgerobbo" date="1249967451"]
Ohh! All that trouble over a closing tag.
[/quote]
and it's only the beginning, my friend...
#16

[eluser]georgerobbo[/eluser]
Haha, I'm sure.




Theme © iAndrew 2016 - Forum software by © MyBB