Jump to content

telepunk

Members
  • Posts

    3
  • Joined

  • Last visited

telepunk's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Sorry, I know this isn't really PHP, but could anyone help me install pear? I don't have ssh access, here is my php info page - http://mobitextpert.com/php_info.php
  2. never fails, as soon as I post, I find the answer... if(!empty($search_minprice)) { $wh = " price >= '{$search_minprice}' "; } if(!empty($search_maxprice)) { $wh .= " AND price <= '{$search_maxprice}' "; } $result = mysql_query("SELECT * FROM listing WHERE ".$wh); $listcount = mysql_num_rows($result); while($row = mysql_fetch_array($result)){ $listid = $row['id']; echo $listid."<br>"; }
  3. Not sure is this is a PHP or MYSQL question.. I have a website and am trying to make a search function. Example would be to search by minimum price, maximum price, minimum square feet, area of town, etc... All of the fields are optional also, so if they leave them blank the search needs to reflect that. I'm fluent in PHP but am running into a brickwall with this one, this is the direction I'm going in, can someone tell me what I'm doing wrong?? *pseudo code... if($search_minprice != ''){ $result = mysql_query("SELECT id FROM listing WHERE price >= '$search_minprice' ORDER BY id ASC "); $row = mysql_fetch_array($result); foreach ($row as &$value) { if($search_livsqft != ''){ $result2 = mysql_query("SELECT * FROM listing WHERE id = '$value' AND livsqft >= '$search_livsqft ORDER BY id ASC "); while($row2 = mysql_fetch_array($result2)){ $street= $row2['street']; echo $street."<br>"; }} }} I'm not too familar with foreach but it seems the way to go for this, I've always been able to avoid using foreach to my own detriment... Any help would be appreciated, thanks!
×
×
  • 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.