Welcome Guest, Not a member yet? Register   Sign In
Can someone help me to edit this function to codeigniter 4
#1

PHP Code:
Please help me edit this function to codeigniter 4
public function makeQuery($minimum_price$maximum_price$brand$ram$storage){
 
$query "SELECT * FROM product WHERE product_status = '1' ";
 if(isset(
$minimum_price$maximum_price) && !empty($minimum_price) && !empty($maximum_price))
 {
 
$query .= "AND product_price BETWEEN '".$_POST["minimum_price"]."' AND '".$_POST["maximum_price"]."'";
 }
 if(isset(
$brand))
 {
 
$brand_filter implode("','"$brand);
 
$query .= "AND product_brand IN('".$brand_filter."')";
 }
 if(isset(
$ram))
 {
 
$ram_filter implode("','"$ram);
 
$query .= "AND product_ram IN('".$ram_filter."')";
 }
 if(isset(
$storage))
 {
 
$storage_filter implode("','"$storage);
 
$query .= "AND product_storage IN('".$storage_filter."')";
 }
 return 
$query;
    

thank you in advance
Reply


Messages In This Thread
Can someone help me to edit this function to codeigniter 4 - by startup - 02-20-2023, 12:21 AM



Theme © iAndrew 2016 - Forum software by © MyBB