filter cars according to their brands

filtrer.png

hiplease help me to filter the cars that's the code of
index.php(displaying cars from database)

<section class="gauto-offers-area section_70">
         <div id="myBtnContainer">
            <input type="hidden" name="marque" id="myInput">
            <div class="row">
               <div class="col-md-12">
                  <div class="site-heading">
                     <h4>Viens avec</h4>
                     <h2>meilleures offres</h2>
                  </div>
               </div>
            </div>
            <div class="row">
               <div class="col-md-12">
                  <div class="offer-tabs">
                     <ul class="nav nav-tabs" id="offerTab" role="tablist">
                        <li class="nav-item" >
                           <a class="nav-link active" id="all-tab"  data-toggle="tab" href="" role="tab" aria-controls="all" aria-selected="true" >Toutes les marques</a>

                        </li>
                        <li class="nav-item" >
                           <a class="nav-link"  id="nissan-tab" data-toggle="tab" href="" role="tab" aria-controls="nissan" aria-selected="false">nissan

                           </a>

                        </li>
                        <li class="nav-item" >
                           <a class="nav-link" id="Toyota-tab"  data-toggle="tab" href="index.html#Toyota" role="tab" aria-controls="Toyota" aria-selected="false">Toyota</a>
                        </li>
                        <li class="nav-item"  >
                           <a class="nav-link"  id="Audi-tab" data-toggle="tab" href="index.html#Audi" role="tab" aria-controls="Audi" aria-selected="false">Audi</a>
                        </li>
                        <li class="nav-item" >
                           <a class="nav-link"   id="mercedes-tab"  data-toggle="tab" href="index.html#mercedes" role="tab" aria-controls="mercedes" aria-selected="false">mercedes</a>
                        </li>
                     </ul>

                     <div class="tab-content" id="offerTabContent">
                        <!-- All Tab Start -->
                        <div class="tab-pane fade show active" id="all" role="tabpanel" aria-labelledby="all-tab">

                         <div class="row  ">
<?php     
$query="select * from voiture";
$query_run=mysqli_query($conn,$query);
$rep = mysqli_fetch_assoc($query_run);
if(mysqli_num_rows($query_run)>0){
 while ($row=mysqli_fetch_assoc($query_run)) {

?>
                     <div class="col-lg-4">
                                 <div class="single-offers">
                                    <div class="offer-image">
                                       <a href="index(1).php">
                                        <?php echo'<img src="admin/admin2/upload/'.$row['image'].'" width="100px;" height="100px;" alt="image">'?>
                                       </a>
                                    </div>

                                    <div class="offer-text">
                                       <a href="index.html#">
                                          <h3><?php echo $row['nom'];?></h3>
                                       </a>
                                       <h4>$<?php echo $row['prix'];?><span>/ Jour</span></h4>
                                       <ul>
                                          <li><i class="fa fa-car"></i><?php echo $row['model'];?><br/></li>
                                          <li><i class="fa fa-cogs"></i><?php echo $row['type'];?><br/></li>
                                          <li><i class="fa fa-dashboard"></i><?php echo $row['kilometrage'];?><br/></li>
                                       </ul>
                                       <div class="offer-action">
                                          <a href="index.html#" class="offer-btn-1">Voiture de location</a>
                                          <a href="car-booking(1).php?id_voiture=<?php echo $row['id_voiture'] ?>" class="offer-btn-2" >Détails</a>
                                       </div>
                                    </div>
                                 </div>
                              </div><?php }}}
                               ?>

                               </div>
                  </div>
               </div>
            </div>
         </div>
      </section>

I think the reason you haven't gotten any responses, even though it's been a full week already, is because you're not really explaining the question you have. I see your query $query="select * from voiture"; ... is that not what you want? Do you need help coming up with a proper SQL query with a WHERE clause that only matches cars that fit certain criteria? Do you need help figuring out how to create HTML for filtering, etc.? Where are you stuck and where can we help?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.