Mikl95 Posted November 22, 2016 Share Posted November 22, 2016 (edited) Hi PHPfreaks! I'am a total noob when it comes to programming, i can read and write a bit of HTML, but thats it. I need help with creating a new undersite for my webpage http://findaphone.dk where you'll be able to watch all models instead of only the ones that matches your answers. The original idea behind the page, were that you could get help finding the smartphone that matches your preferences, but as I see the aren't really converting, i will give the users the ability to go to a page where they can see all models that we offer on the site. I think coding wise, it should be pretty simple, because the code is already written, but instead of sorting of phones, as it does now, it should simply show all available opportunities. My PHP code looks like this right now: // Main First Search (4 Questions) public function filter() { $price = $this->input->post('price'); if ($price == '3000') { $price2 = '0'; } else if ($price == '5500') { $price2 = '3000'; } else if ($price == '6000') { $price = '10000'; $price2 = '3500'; } $size = $this->input->post('size'); $type = $this->input->post('type'); $design = $this->input->post('design'); //echo "SELECT * FROM `product_info` WHERE `ac_price` > $price2 AND `ac_price` <= $price AND `design` = '$type' AND `size` = '$size' AND `type` = '$design' GROUP BY `id` ORDER BY `rating` DESC";die; $filter = $this->queries->custom("SELECT * FROM `product_info` WHERE `ac_price` > $price2 AND `ac_price` <= $price AND `design` = '$type' AND `size` = '$size' AND `type` = '$design' GROUP BY `id` ORDER BY `rating` DESC"); if ($filter == null) { echo ''; } I think thats the part where the site chooses the phones that matches the answers from the database. If not please tell me how it should look like. Thanks for your help in advance!! Edited November 22, 2016 by Mikl95 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.