Monday 15 February 2010

drupal - db_query returns one row when it shouldn't -


I'm trying to check if a search query contains a zip code in drupal 7

 $ Input = filter_var ("url") ("(" $ "v" ["view"] - & gt; exposed_input)) $ vars ["view"] - & gt; Exposed_input ["distance"] ["postal_code"]: $ vars ["view"] - & gt; Exposed_first input ["distance"] ["postcode"])), FILTER_SANITIZE_STRING; If ($ result = db_query ("select zip, city, state, country from zipcodes, zip =: zip", array (": zip" => $> input)) {if ($ result-> RowCount () & gt; 0) {// city state and country meet} and {// input is not a zip code}}   

The problem is that when I do a non-zip I set the input to the code, still input field and city state and country do anything to do with a zip field set

I could only check that city state and country is nothing But i co Way I want to work

Does anyone even know why a row when a database?

This is because the droplet creates a new row in the database, before I count the row Check out

No comments:

Post a Comment