Hi All,
I am new to php (moved over from perl) So I am learning php by example! I am looking for a search script like the one found here:
http://www.iphotocentral.com/search/search.php
I need to be able to search between dates using a dropdown or series of dropdowns yyyy-mm-dd ( I beleive that is mysql's default) as well as have a few other drop downs... I am really having a tough time finding a script like this! most of the examples I have come across are very simple search forms and only have one or two fields, which doesn't enable me to actually "build" a query!
Thanks in Advance,
-Paul
search script
Moderator: General Moderators
sounds like a plan...
thanks... I will give it a go.. I will post for help here!
-Paul
-Paul
Avatar, thanks for pushing me
so far so good! I was almost done and now I am trying to throw one more form variable into the mix! It is killing me!
I have a select box in my form that submits to seperate document list.php
All Counties = ALL
Residential = R
Vacant Land = V
the results get paged on list.php via a url string. for some reason, the variable is not getting cleared when All Counties is selected value="ALL" and I end up with &type= in my url string, when I don't want it there! I get the first 10 results and then when I click on Next 10, My query gets screwed up! if I choose Residential or Vacant Land it sails through all the pages no problem!
if ($type != "ALL"){
$query .= " AND TYPE = '$type'"; // builds on my query
$var2 = "&type=$type"; // this builds into the url string
} else {
$type = ""; // this is where I am hoping to clear out these variables if $type = ALL!
$var2 = "";
}
I have a similar snippet above it for Counties which works just fine. Although it is numerical
$allCounties = 0;
if ($county > $allCounties){
$query .= " AND COUNTY = $county";
$var1 = "&county=$county";
} else {
$county = "";
$var1 = "";
}
I am probably overlooking the obvious!
thanks,
-Paul
so far so good! I was almost done and now I am trying to throw one more form variable into the mix! It is killing me!
I have a select box in my form that submits to seperate document list.php
All Counties = ALL
Residential = R
Vacant Land = V
the results get paged on list.php via a url string. for some reason, the variable is not getting cleared when All Counties is selected value="ALL" and I end up with &type= in my url string, when I don't want it there! I get the first 10 results and then when I click on Next 10, My query gets screwed up! if I choose Residential or Vacant Land it sails through all the pages no problem!
if ($type != "ALL"){
$query .= " AND TYPE = '$type'"; // builds on my query
$var2 = "&type=$type"; // this builds into the url string
} else {
$type = ""; // this is where I am hoping to clear out these variables if $type = ALL!
$var2 = "";
}
I have a similar snippet above it for Counties which works just fine. Although it is numerical
$allCounties = 0;
if ($county > $allCounties){
$query .= " AND COUNTY = $county";
$var1 = "&county=$county";
} else {
$county = "";
$var1 = "";
}
I am probably overlooking the obvious!
thanks,
-Paul