Welcome Guest, Not a member yet? Register   Sign In
How to convert from Mysql query to Codeigniter syntax?
#3

[eluser]sovandy[/eluser]
I have tested it,but it doesn't work.
$this->db->select('COUNT(lib_books.boo_id)AS number', FALSE);
$this->db->join('lib_books', 'lib_books.boo_id = lib_borrowings.boo_id', 'inner');
$this->db->group_by('lib_books.boo_id');
$count=$this->db->get('lib_borrowings');
echo $count;
I echo $count is just want to know what it return by that function.
it shows me the error:

A PHP Error was encountered

Severity: 4096

Message: Object of class CI_DB_mysql_result could not be converted to string

Filename: models/book_model.php

Line Number: 142


Messages In This Thread
How to convert from Mysql query to Codeigniter syntax? - by El Forum - 06-16-2009, 09:15 PM
How to convert from Mysql query to Codeigniter syntax? - by El Forum - 06-16-2009, 09:22 PM
How to convert from Mysql query to Codeigniter syntax? - by El Forum - 06-16-2009, 09:42 PM
How to convert from Mysql query to Codeigniter syntax? - by El Forum - 06-16-2009, 10:09 PM
How to convert from Mysql query to Codeigniter syntax? - by El Forum - 06-16-2009, 11:09 PM
How to convert from Mysql query to Codeigniter syntax? - by El Forum - 06-17-2009, 02:42 AM
How to convert from Mysql query to Codeigniter syntax? - by El Forum - 06-17-2009, 02:46 AM



Theme © iAndrew 2016 - Forum software by © MyBB