nineseveninteractive Posted July 12, 2007 Share Posted July 12, 2007 hi i'm having a problem with the search function on the following site www.jasonmillward.com basically when you use the drop to perform a search it all works fine and pulls the correct results from the database expect when you do a search for the first term in the array - in this case hotel / catering jobs where by the full results are shown. below is the code that performs the search function career_level($c, $id) { $levels = array("Hotel / Catering Jobs", "Industrial / Warehouse Jobs", "Office Jobs", "Sales Jobs"); if($id >= '0') { $level = $levels[$id]; return $level; } else { $select = "<select name=\"careerlevel\">\n\t"; while(list($k,$v) = each($levels)) { if($c >= '0') { if($c == $k) { $select .= "<option value=\"$k\" selected>$v</option>\n\t"; } else { $select .= "<option value=\"$k\">$v</option>\n\t"; } } else { $select .= "<option value=\"$k\">$v</option>\n\t"; } } $select .= "</select>\n\n"; return $select; } } coud anyone tell me why thsi is happening and how i would go about correcting the problem. i've been trying for a few days with no joy many thanks in advance Link to comment https://forums.phpfreaks.com/topic/59712-array-problem/ Share on other sites More sharing options...
teng84 Posted July 12, 2007 Share Posted July 12, 2007 can i see the query i view the source and the all value is '' and the 1st array is 0 maybe you have a condition b4 querying like >0 or <0 you know what i mean show us the code on that query and all that affects the query Link to comment https://forums.phpfreaks.com/topic/59712-array-problem/#findComment-296811 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.