•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 402,741 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,467 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 512 | Replies: 2
![]() |
•
•
Join Date: Mar 2007
Posts: 5
Reputation:
Rep Power: 0
Solved Threads: 0
Hi guys, well as the thread title says, i've made a search engine for a property site that uses a form to specify what to search (ie. property status, type, location, bedrooms, price). And outputs as a table.
The problem is i don't know how to make the function return the results that i've specifically searched for, currently my php coding goes like this:
I've tried using AND but that returns no results, so can anyone help me?
The problem is i don't know how to make the function return the results that i've specifically searched for, currently my php coding goes like this:
•
•
•
•
<?php
// form variables
if (isset($_POST['prop_status'])) {$status = $_POST['prop_status']; } else { $status = ""; }
if (isset($_POST['prop_type'])) {$prop_type = $_POST['prop_type']; } else { $prop_type = ""; }
if (isset($_POST['location'])) {$location = $_POST['location']; } else { $location = ""; }
if (isset($_POST['bedrooms'])) {$bedrooms = $_POST['bedrooms']; } else { $bedrooms = ""; }
if (isset($_POST['min_price'])) {$min_price = $_POST['min_price']; } else { $min_price = ""; }
if (isset($_POST['max_price'])) {$max_price = $_POST['max_price']; } else { $max_price = ""; }
mysql_select_db($database, $dbconnect);
$query_dosearch = "SELECT * FROM ".$sitename."_properties WHERE status = '$status' OR property_type = '$prop_type' OR location = '$location' OR num_bedrooms = '$bedrooms' OR price BETWEEN '$min_price' AND '$max_price' ";
$dosearch = mysql_query($query_dosearch, $dbconnect) or die(mysql_error($dbconnect));
$row_dosearch = mysql_fetch_assoc($dosearch);
$totalRows_dosearch = mysql_num_rows($dosearch);
?>
I've tried using AND but that returns no results, so can anyone help me?
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
adsense adult advertising algorithms blog blogging bomb book business coding competition copyright daniweb development engine environment forum gasoline gentoo google hybrid internal combustion engine legal linux malware marketing mcafee microsoft monetization msn news pagerank php privacy publishing revenue search security seo sex silverlight software spam spyware support technical web webmaster wiki yahoo
- The secrets of google search engine ranking (Promotion and Marketing Plans)
- a few search engine optimization questions (Search Engine Optimization)
- Internet Explorer Freezes when using a search engine (Windows 9x / Me)
- Intigrating a search engine into a website. (Existing Scripts)
- Deleting subjects in a search engine window (Web Browsers)
- Using Search Engine Friendly PHP URLs (PHP)
Other Threads in the PHP Forum
- Previous Thread: hiding suplemental php files
- Next Thread: Loops


Linear Mode