Jump to content

Show all data from database


Mikl95

Recommended Posts

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 by Mikl95
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.