Код: Выделить всё
table name : mytable
id name salt value
1 a 10 39
2 a 20 13
3 a 10 14
4 b 40 39
Код: Выделить всё
public function get_value_by_name($name)
{
$this->db->select("*");
$this->db->from("mytable");
$this->db->where('salt', '10');
$this->db->where('name', $name);
$this->db->order_by('id', "ASC");
$this->db->limit(1);
$query = $this->db->get();
if ($query != null) {
return $query->result();
} else {
return array();
}
}
Подробнее здесь: https://stackoverflow.com/questions/260 ... uery-build
Мобильная версия