Welcome Guest, Not a member yet? Register   Sign In
Problem With WHERE Clause
#10

[eluser]james182[/eluser]
Here is what i have changed to:
Code:
public function get_diamond_by_shape($shape,$scat_id,$colour,$clarity,$certification,$cut,$polish,$symmetry,$fluorescence,$min_carat,$max_carat,$min_price,$max_price)
{
$colours = explode('-', substr_replace($colour ,"",-1)); // outputs an array - array('D','E','F')
  $clarities = explode('-', substr_replace($clarity ,"",-1));
  $certifications = explode('-', substr_replace($certification ,"",-1));  
  
  $this->db->where('shape', $shape);
  
  $this->db->where_in('colour', $colours);
  $this->db->where_in('clarity', $clarities);
  $this->db->where_in('certification_type', $certifications);
  $this->db->where_in('cut', $cut);
  $this->db->where_in('polish', $polish);
  $this->db->where_in('symmetry', $symmetry);
  $this->db->where_in('fluorescence', $fluorescence);    
  
  $this->db->where('carat >=', $min_carat);
  $this->db->where('carat <=', $max_carat) ;
  $this->db->where('cost BETWEEN ' . $min_price . ' AND ' . $max_price);
  
  $diamonds = $this->db->get('products_diamonds');
  
  print_r($diamonds->result_array());
      
  //return $diamonds->result_array();
}
But this return nothing..

Here is the post data, could someone please post a working solution, as i have run out of ideas.

Code:
certi
cla
col D-E-
cut
flou
maxprice 100000
maxval 5
minprice 100
minval 0.01
pg 1
polish
scat_id
shape Princess
sym


shape=Princess&scat;_id=&col=D-E-&cla;=&certi;=&cut;=&polish;=&sym;=&flou;=&minval=0.01&maxval=5&minprice=100&maxprice=100000&pg=1



Messages In This Thread
Problem With WHERE Clause - by El Forum - 06-22-2012, 01:47 AM
Problem With WHERE Clause - by El Forum - 06-22-2012, 01:53 AM
Problem With WHERE Clause - by El Forum - 06-22-2012, 02:10 AM
Problem With WHERE Clause - by El Forum - 06-22-2012, 02:39 AM
Problem With WHERE Clause - by El Forum - 06-22-2012, 03:22 AM
Problem With WHERE Clause - by El Forum - 06-22-2012, 03:43 AM
Problem With WHERE Clause - by El Forum - 06-22-2012, 04:10 AM
Problem With WHERE Clause - by El Forum - 06-22-2012, 04:21 AM
Problem With WHERE Clause - by El Forum - 06-22-2012, 06:55 AM
Problem With WHERE Clause - by El Forum - 06-22-2012, 06:50 PM
Problem With WHERE Clause - by El Forum - 06-22-2012, 10:34 PM
Problem With WHERE Clause - by El Forum - 06-22-2012, 10:38 PM
Problem With WHERE Clause - by El Forum - 06-22-2012, 10:50 PM
Problem With WHERE Clause - by El Forum - 06-22-2012, 10:56 PM
Problem With WHERE Clause - by El Forum - 06-22-2012, 11:13 PM
Problem With WHERE Clause - by El Forum - 06-22-2012, 11:16 PM
Problem With WHERE Clause - by El Forum - 06-23-2012, 02:12 AM



Theme © iAndrew 2016 - Forum software by © MyBB