![]() |
| ||
| I have problem with two value search Dear All, I have problem with two value search, Please kindly see my code below: <? require("../Dbconnect/db_connect.php");?>My problem is when I choose the location=All location is ok but when I choose both Values it doesn't select the right criteria that I wish. |
| ||
| Re: I have problem with two value search Hey, You've posted a huge code segment but not explained what it does or why it does it? Your description is rather vauge and I, for one, don't really want to dig through all that code looking for a problem I don't know about. Chris |
| ||
| Re: I have problem with two value search Quote:
My problem is that I can search only both values like All=location and All category is fine But I if select Location=Phnom Penh and Category= Computer is not show me the right criteria. Thank so much in advance for your million help. Kindly regards, Bunhok |
| ||
| Re: I have problem with two value search Hey, I've spotted a slight problem near the beginning of your script. The section where you loop to show the job categories writes the category ID and the category name into an option field. You have a default field named "All Categories" with the value of 0. However, in MySQL, I believe it may be possible to get an index of 0.. this would produce html like this: <option value="0">All Categories</option> I recommend you make the "All Categories" and "All Locations" values to -1, a number outside the range of what MySQL may return. This will stop any duplication problems. As I mentioned earlier, it's very difficult to read your code, so this next comment may be wildly off. On line 33, you check to see if "All Categories" and "All Locations" has been selected and you have tailored an entire section querying the database for that, and in the corresponding else statement (Line 97), you've begun to show the HTML table code, but you've commented out everything else to do with the database from line 111 onwards? I hope this helps, Christopher Lord |
| All times are GMT -4. The time now is 5:53 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC