|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome. |
Share Thread: & Tags
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hello,
I am using a acme agent real estate listing program for my site and I have made a few modifications to it. My problem arises when I try to filter my search results by price (min or max). If I use any filters (lets say min $100000 and max $300000) it will not return only those results. It will return all results regardless of price. here are some code snippets that I believe contribute to this but I can't seem to narrow it down: (this is near the start where I assume it checks if they are set and assign it if not) [code] if(!isset($_GET["min_price"])) $min_price = $_SESSION["min_price"]; else $min_price = $_GET["min_price"]; if(!isset($_GET["max_price"])) $max_price = $_SESSION["max_price"]; else $max_price = $_GET["max_price"]; [\code] (and what I believe is the sql query) [code] $sqlCnt = "SELECT COUNT(c.id) FROM ".$db_prefix."listings AS c INNER JOIN ".$db_prefix."sellers AS d ON d.id=c.member_id WHERE d.status='Active' AND (c.mls LIKE '%$mls%' OR '$mls'='') AND (c.category LIKE '%$category%' OR '$category'='') AND (c.lstate LIKE '%$lstate%' OR '$lstate'='') AND (c.bath >= '$bath' OR '$bath'='') AND (c.beds >= '$beds' OR '$beds'='') AND (c.price >= '$min_price' OR '$min_price'='') AND (c.price <= '$max_price' OR '$max_price'='') ".$filterKeyword." ". //AND (d.zip LIKE '%$zip%' OR '$zip'='') $zipstring." AND (c.member_id='$dealer_id' OR '$dealer_id'='')"; [\code] If you want to view the live site and test for yourself, then please look here: www.belize-realestate-investments.com If you want the actual file msg me and I will send it to you. Any help with this would be greatly appreciated. Thanks Rob
__________________
Rob |
|
||||
|
There seem to be a problem with your webserver. When I put the link in your signature in my browser, I get the following warnings and errors.
Warning: main(counter/phpcounter.php) [function.main]: failed to open stream: No such file or directory in /home/sovweb/public_html/index.php on line 104 Warning: main(counter/phpcounter.php) [function.main]: failed to open stream: No such file or directory in /home/sovweb/public_html/index.php on line 104 Warning: main(counter/phpcounter.php) [function.main]: failed to open stream: No such file or directory in /home/sovweb/public_html/index.php on line 104 Fatal error: main() [function.require]: Failed opening required 'counter/phpcounter.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/sovweb/public_html/index.php on line 104 If that is not the problem: Quote:
__________________
Mini Network:: Financial information at your fingertips Learn object oriented programming where it started Last edited by kgun; 05-31-2008 at 07:45 PM. |
|
|||
|
Yes, unfortunately (in some regards) I have not been able to maintain my own site... fortunately, it has been because I am too busy
It will be migrating to a new name and look in the near future. Any help with the problem that I posted though would be great
__________________
Rob |
|
||||
|
That was why I wrote the second part of my post.
|
|
||||
|
Ok, then you are new to programming. The following are data types:
Link: C Data types
__________________
Mini Network:: Financial information at your fingertips Learn object oriented programming where it started Last edited by kgun; 05-31-2008 at 08:35 PM. |
|
||||
|
Quote:
Inner joins, definitely not for beginners. And that query " ... " is not short. I would have stripped it down to a minimum, printed it out and expanded it step by step printing it out in every step to see that it is OK.
__________________
Mini Network:: Financial information at your fingertips Learn object oriented programming where it started Last edited by kgun; 05-31-2008 at 08:51 PM. |
|
|||
|
Sorry for the delay in getting back to you.
I check the data type and is sufficient (varchar (255)). Also I did not program this so some of it is way outside my expertise. How would you replace the inner join with something simpler? Could I send you the php file and have you look at it to make a recommendation? Thanks Rob
__________________
Rob |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| FeedPlex Adds New Search Filters | WPW_Feedbot | Search Engine Optimization Forum | 0 | 07-11-2005 10:30 AM |
| Need Help With Spam Filters Test | prattboy | Introductions | 1 | 02-25-2005 12:56 PM |
| New filters on the horizon? | activeco | Google Discussion Forum | 2 | 02-04-2005 12:53 AM |
| to get through the filters | hkaamir | Marketing Strategies Discussion Forum | 12 | 05-07-2004 04:11 AM |
| Water Filters - in australia | David Pearson | Marketing Strategies Discussion Forum | 0 | 02-22-2004 08:31 PM |
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2009 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |