php - Skip some columns when doing a select -


i building ajax web application , displaying chain select in jquery selecting behind scenes , saves me lots of time writing new routes , views.however,i know if there way reduce work further not writing new models.

i have controller

<?php class tools extends ci_controller {      public function message($to = 'world')     {         echo "hello {$to}!".php_eol;     }     public function boom(){     echo "boom".php_eol;     }     public function q(){     $sql = "select * members member_id = ? , member_club_id = ? , membership_year = ?";      $count = $this->db->query($sql, array(null, 1, null));     foreach ($count->result() $row)     {     echo $row->member_name . php_eol;      }     } } ?> 

which attempt skip column , display other.

this sql equivalent

select * members member_id = null , member_club_id = 1 , membership_year = null; 

they both don't display anything.is there way can skip column of choosing?.

you can explicitly set columns returned this

select id, member_name members member_id = null , member_club_id = 1 , membership_year = null; 

if mean 'skip rows' can use limit

select * members member_id = null , member_club_id = 1 , membership_year = null limit 5, 5; 

this return columns rows 6, 7, 8, 9, , 10


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -