Welcome Guest, Not a member yet? Register   Sign In
Query problem
#1

[eluser]Bigil Michael[/eluser]
my table structure like this
id name specialization_id specialization2_id specialization3_id shift_timing

1 A 1 2 3 8.00
2 B 3 4 5 8.00

i want to select the result where shift_timing = 8.00
and specialization id in any one of these three columns.
i write the query like this

Code:
function search_doctors($time,$specialization)
{
  $this->db->where('shift_timing', $time);
  $this->db->or_where('specialization_id', $specialization);
  $this->db->or_where('specialization2_id', $specialization);
  $this->db->or_where('specialization3_id', $specialization);
  $result_all = $this->db->get('tablename');
  return $result_all->result();
}

it willnot show the correct result. can any one tell me , is any problem in my code..





Theme © iAndrew 2016 - Forum software by © MyBB