Jump to content

mdattani

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

mdattani's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello everyone, I have a search facility on my homepage for a property lettings website. There are 3 search parametres, location, rent and type (e.g. 1bed). It passes the parametres to the results.php page and displays the results in a table. When there are no results, it still displays a table, but it is empty. How do I display some text that says "No Results" instead of an empty table?? Thanks guys
  2. Hi everyone, I was developing on a Windows 32bit machine till December, and then bought a 64bit machine which I built myself. I'm running Windows XP x64 edition and have had some problems with Internet Explorer. Everytime I run the browser and go to localhost it will say "The page cannot be displayed" But if i press enter again on the link then it will display the pic. The same thing happens on Firefox with the message "The connection was reset". But if i click Go on the link again, it will find it. It's not the browser, as I am using 32bit versions of IE and Firefox, but i get the same problem with the 64bit IE. Very confused as to why this is happening, any ideas? Thanks
  3. Thanks 'only i can' I just tried doing it that way, and turns out, the way i was using the variables was completely wrong. Also thanks Barnard for the BETWEEN tip, it's much more elegant to put it that way rather than  car.price >= $price and car. price etc etc etc Thanks guys Problem Solved
  4. HI, I have a problem with my SQL query, firstly variables below all equal;   $make = Audi   $model = TT   $mileagelow = 500   $mileagehigh = 70000   $pricelow = 1000   $pricehigh = 20000 The SQL statement is shown below; $query = "select * from car, cardetails, comments where car.make like '$make' and car.model like '$model' and car.mileage >= ‘$mileagelow’ and car.mileage <= ‘$mileagehigh’ and car.price >= ‘$pricelow’ and car.price <= ‘$pricehigh’ "; It can find a car without the mileage and price parameters, however when I include the last 2 lines, it can’t find any cars. The mileage and price variables are being posted from a Select Drop Box in a search page and the make and model variables are also being posted using a Select Drop Box. Not sure what the problem is with those two lines, any help would be much appreciated. Thanks
  5. Hi everyone, I am new to php, and have been using the drop down list example on http://www.plus2net.com/php_tutorial/php_drop_down_list.php It is working fine, and comes up with the correct details from the mysql database. However when I click submit, and on my results.php page, i have a $make=$_POST['make']; which is posting the index from the first drop box select name "make", it is actually posting the value    "1" when for example "Audi" is selected, instead of the value in the drop down box. I understand that it is posting the index of the value selected, however I want it to post the value of the actual drop down box when it is selected, e.g. "Audi" instead of "1",  ("Audi" being index 1 from my database) Any help would be very much appreciated. Thanks people! My code is pasted below; function reload(form) { var val=form.make.options[form.make.options.selectedIndex].value; self.location='search.php?make=' + val ; } </script> </head> <body> <? $quer2=mysql_query("SELECT make,cat_id FROM make order by make"); $make=$HTTP_GET_VARS['make']; if(isset($make) and strlen($make) > 0){ $quer=mysql_query("SELECT model FROM model where cat_id=$make order by model"); }else{$quer=mysql_query("SELECT model FROM model order by model"); } echo "<form method=post name=f1 action='results.php'>"; echo "<select name='make' onchange=\"reload(this.form)\"><option value=''>Select one</option>"; while($noticia2 = mysql_fetch_array($quer2)) { if($noticia2['cat_id']==@$make){echo "<option selected value='$noticia2[cat_id]'>$noticia2[make]</option>"."<BR>";} else{echo  "<option value='$noticia2[cat_id]'>$noticia2[make]</option>";} } echo "</select>"; echo "<select name='model'><option value=''>Select one</option>"; while($noticia = mysql_fetch_array($quer)) { echo  "<option value='$noticia[model]'>$noticia[model]</option>"; } echo "</select>"; echo "<input type=submit value=Submit>"; echo "</form>";
×
×
  • 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.