1 回答
TA贡献1803条经验 获得超6个赞
简单的方法是
$this->db->select('*');
$this->db->from('Clubs');
if ($clubname <> NULL) {
$this->db->like('Clubname', $clubname, 'both'); }
if ($street <> NULL) {
$this->db->like('Street', $street, 'both'); }
if ($postalcode <> NULL) {
$this->db->like('Postalcode', $postalcode, 'both'); }
if ($city <> NULL) {
$this->db->like('City', $city, 'both'); }
if ($homepage <> NULL) {
$this->db->like('Homepage', $homepage, 'both'); }
if ($email <> NULL) {
$this->db->like('Email', $email, 'both'); }
if ($telephone <> NULL) {
$this->db->like('Telephone', $telephone, 'both');
}
$query = "CREATE TABLE SearchedClubs AS (" . $this->db->get_compiled_select() . ")";
$this->db->query($query);
- 1 回答
- 0 关注
- 155 浏览
添加回答
举报