1 of 3
fefe
  • 874
  • 3
  • 14
  • 34

Active DB queries in Wordpress?

I just make some researches regarding to wordpress DB queries and I just wonder if I miss something

a normal SELECT query for example in Codeigniter with active records would look like if I assume I init my DB instance in both of the cases inside of a Class as $this->db

$data = $this->db->get('wp_mytable');
$data->result();

Wordpress way

$data = $this->db->get_results('SELECT * FROM wp_mytable');

end if I would use a condition than would look like

$this->db->select('*');
$this->db->from('wp_mytable');
$this->db->where('id', 1);
$this->db->result();

I found this handy if I would use more than on WHERE as array

but I do not see this kind of query types in wordpress wiki or I do not search in the right place?

fefe
  • 874
  • 3
  • 14
  • 34