Best bet is not to repost. Keep the conversation under a
single thread,
please.
--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"The_FedEx_Guy" <webforumsuser@macromedia.com> wrote in
message
news:fuko4q$amu$1@forums.macromedia.com...
> I'm still having the problem to my SQL post.
>
> // define an array of acceptable property types
> $propTypes = array('Houses', 'Flats/Apartments',
> 'Bungalows','Commercial');
> // if submitted value is in the array of acceptable
types, use it
> // otherwise, use a wildcard character
> if (isset($_REQUEST['PropType']) &&
in_array($_REQUEST['PropType'],
> $propTypes)) {
> $PropType = "= '".$_REQUEST['PropType']."'";
> } else {
> $PropType = "LIKE '%'";
> }
>
>
> // check that the number of bedrooms is a number
> // if it's zero, search for all numbers
> if (isset($_REQUEST['NoBeds']) &&
is_numeric($_REQUEST['NoBeds']) &&
> $_REQUEST['NoBeds'] == 0) {
> $NoBeds = '> 0';
> } elseif (isset($_REQUEST['NoBeds']) &&
is_numeric($_REQUEST['NoBeds']) &&
> $_REQUEST['NoBeds'] > 0) {
> $NoBeds = '= '.$_REQUEST['NoBeds'];
> } else {
> $NoBeds = '> 0';
> }
>
> // if minPrice is not a number, set it to zero
> // otherwise, use the submitted value
> if (isset($_REQUEST['minPrice']) &&
!is_numeric($_REQUEST['minPrice']) ||
> !isset($_REQUEST['minPrice'])) {
> $minPrice = 0;
> } elseif (isset($_REQUEST['minPrice']) &&
> is_numeric($_REQUEST['minPrice'])) {
> $minPrice = $_REQUEST['minPrice'];
> }
>
> // if maxPrice is not a number, set it to 100 million
> // otherwise, use the submitted value
> if (isset($_REQUEST['maxPrice']) &&
!is_numeric($_REQUEST['maxPrice']) ||
> !isset($_REQUEST['maxPrice'])) {
> $minPrice = 100000000;
> } elseif (isset($_REQUEST['maxPrice']) &&
> is_numeric($_REQUEST['maxPrice'])) {
> $minPrice = $_REQUEST['maxPrice'];
> }
> mysql_select_db($database_db, $db);
>
> $query_Recordset1 = "SELECT *
> FROM property
> WHERE B_R = 'BUY'
> AND Accepted = 'Yes'
> AND (City = '$_REQUEST
quote:
') Or Postcode LIKE '%$_REQUEST
quote:
' Or Area =
> '$_REQUEST
quote:
'
> AND PropType = '$_REQUEST[PropType]'
> AND NoBeds = '$NoBeds'
> AND Country = 'UK'
> AND Cost BETWEEN '$minPrice' AND '$maxPrice'
> ORDER BY Cost $_REQUEST[sort]";
>