mardi 29 mars 2016

Remove repetition in php

I want to create a search bar

I give order to the visitor the chose category and city for the first I select ALL from category table in database, but about city I have a problem, I Select City from projects, but I have the same city in many projects.

I want to remove the repetition if the city it's in many projects

this's the php code

$sql_city = "SELECT city FROM project";
$run_city = mysqli_query($conn,$sql_city);
while($rows_city = mysqli_fetch_assoc($run_city)){

        echo '<option value="">'.$rows_city['city'].'</option>';

                                                                }

Aucun commentaire:

Enregistrer un commentaire