[eluser]xwero[/eluser]
[quote author="leon_dewey" date="1203011641"]I am getting some strange errors
This works
$this->read->select('*')->from($this->table)->where_in('username', $username);
This does not (i get a fatal error)
$this->read->select('*')->from($this->table)->where_in('username', $username)->limit(0,1);
This works, but i get no results
$this->read->select('*')->from($this->table)->limit(0,1)->where_in('username', $username);
Any ideas?
(I use a read database and write database thus the connection read, i have tryed with the traditional db)[/quote]
Strange you get results from the first statement? You haven't added the action
Code:
$this->read->from($this->table)->where_in('username', $username)->get();
$this->read->from($this->table)->where_in('username', $username)->limit(0,1)->get();
$this->read->from($this->table)->limit(0,1)->where_in('username', $username)->get();
This should do the trick. If you want to get all the fields you don't have to add the select because it's the default value.
edit : i though you were talking about the read as a database
Code:
var $read;
function model()
{
$this->read = $this->load->database('dbname');
}
But i guess you have written your own database library, or not?