currently i'm using codeigniter then i see that can use the library db in 2 styles
$result = $this->db->select($id)
->select($field)
->get('user');
and like this
$this->db->select($id)
$this->db->select($field)
$result = $this->db->get('user');
to a better designer which style is better, exist some pattern between developers php codeigniter
There is no Best way. Its all about your practice.
There are 3 Methods to code
Method 01
$result = $this->db->select($id)
->select($field)
->get('user');
Method 02
$this->db->select($id)
$this->db->select($field)
$result = $this->db->get('user');
Method 03
$query = $this->db->query("SELECT * FROM user")
$result = $query->result_array();
You can use any way that you like. Code will execute in all this way.
Note : Method 01 and Method 02 from your Question and Method 03 is which i used.(Method 03 is tested and works well)