VB ASRAAF007's Profile User Rating: -----

Reputation: 1 Apprentice
Active Members
Active Posts:
86 (0.06 per day)
11-April 12
Profile Views:
Last Active:
User is offline Feb 25 2014 03:03 AM

Previous Fields

Dream Kudos:
Icon   VB ASRAAF007 has not set their status

Posts I've Made

  1. In Topic: php search by two select option consecutively

    Posted 25 Feb 2014

    i've used the "AND" and the "OR" also. The end is that i must choose both of the menus [categories & district] whereas the "OR" i can select only one. what i want here is to use both of them...either when 1 is selected or the other 1 ...
  2. In Topic: php search by two select option consecutively

    Posted 24 Feb 2014

    yes i've just tried it manually and it worked...now when i do the search, even if i have other records with the district "Port Louis" and i choose the categorie "Chaussures", the search gives me the following records:

    Categorie : Chaussures
    District : Port Louis

    but along side it gives me other records with with different categories but with the district "Port Louis". What i want is to limit the search to only as per the categorie selected, which in this case:

    Categorie : Chaussures
    District : Port Louis

    and it do not display other different results with the district "Port Louis"
  3. In Topic: php search by two select option consecutively

    Posted 24 Feb 2014

    yes of course...here are them..

    this is the second <select option>

    <select name="search_district" id="select_district" class="searcharea">
    		<option style="background-color:#bec9ff;" value="0">-- Districts --</option>
    		<option value="port_louis">Port Louis</option>
    		<option value="black_river">Black River</option>
    		<option value="pamplemousses">Pamplemousses</option>
    		<option value="flacq">Flacq</option>
    		<option value="moka">Moka</option>
    		<option value="grand_port">grand_port</option>
    		<option value="plaine_wilhems">Plaine Wilhems</option>
    		<option value="savanne">Savanne</option>
    		<option value="riviere_du_rempart">Riviere du Rempart</option>
    		<option value="rodrigues">Rodrigues</option>

    and these are my php codes

    if(isset($_GET['search_offres_categorie']) && !empty($_GET['search_offres_categorie']) )
     $var1 = $_GET['search_offres_categorie'];
        echo '</br>';
    	 $search_value1 = $_GET['search_offres_categorie'] ;
    	 $search_value2 = $_GET['search_district'];
    	 	 	  $query = "SELECT * FROM `deposer_une_annonce` WHERE categorie LIKE '%$search_value1%' OR district LIKE '%$search_value2%' order by id desc limit 20 ";
      $run = mysql_query($query) or die(mysql_error());
    		  while($row = mysql_fetch_array($run)){
    		  	$district = $row['district'];
    		  	$categorie = $row['categorie'];
    			$prix = $row['prix'];
    			$telephone = $row['telephone'];
    			$ville = $row['ville'];
    			$titre_annonce = $row['titre_annonce'];
    			$image_principale_1 = $row['photo_principale'];
                            $date = $row['date_time'];
    			echo "<br>";
    	echo "<a style='text-decoration:none;' href=\"search_offres_display.php?id=" . $row['ID']. "\">"; 
    				echo  "<label style='margin-left:30px;'>Mise en ligne le:  $date</label>"; 
    				echo "<div style='text-align:center;'><h4><p><label style='color:blue;'>$titre_annonce</label></h4>";
    				echo "<strong>$categorie</strong> <p>";
    				echo "<strong> $district / $ville  </strong></p>";
    				echo "<label style='color:orange;'>&euro;</label> $prix <p></div>";
    				echo "<img style='margin-top:-150px; margin-left:110px;' src=$image_principale_1 height='150' width='150'>";
                echo "</a>";
    			echo "<hr style='margin-top:20px; margin-left:25px; width:720px;'>";
  4. In Topic: php search by two select option consecutively

    Posted 24 Feb 2014

    i've used 'AND' but it returns nothing...it returns only the last selection means District...but i want the search to take both into consideration and filters it accordingly..

My Information

Member Title:
D.I.C Head
Age Unknown
Birthday Unknown

Contact Information




Page 1 of 1
  1. Photo

    VB ASRAAF007 Icon

    27 Apr 2012 - 10:43
    Korect..yep He's my tutor...Sir charlie
  2. Photo

    vikxit Icon

    26 Apr 2012 - 19:00
    Ki dir frero?
    CharlieMay p bien aide toi mo truver ein...lol
Page 1 of 1