Welcome Guest, Not a member yet? Register   Sign In
Fatal error: Call to undefined method CI_DB_mysql_driver::result()
#3

[eluser]ferno[/eluser]
nope, i tried using 'RAND()' and RAND()

EDIT: I found the solution, the correct code is:

Code:
$this->db->select('artist,title,location')->from('songs')->orderby('RAND()')->limit(1);

            $query = $this->db->get(); // the magic line :D

            foreach ($query->result() as $row)
        {
            echo $row->artist;
            echo $row->title;
            echo $row->location;
        }


Messages In This Thread
Fatal error: Call to undefined method CI_DB_mysql_driver::result() - by El Forum - 12-21-2007, 02:23 PM



Theme © iAndrew 2016 - Forum software by © MyBB