Link to home
Start Free TrialLog in
Avatar of meno19
meno19

asked on

Multiple MySql AND Statements

I know the syntax is not correct. How would I go about using multiple and statements?

SELECT * FROM `search` WHERE company_name LIKE '%pizza%' 
and 
latitude BETWEEN 38.69852058020537 AND 41.224260426268195 
AND 
longitude BETWEEN -75.97329101562502 AND -75.97329101562502 
LIMIT 0, 25

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of johanntagle
johanntagle
Flag of Philippines image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of meno19
meno19

ASKER

Sneaky Bastard doesn't throw and error. Sometimes the query runs and does not return results. It doesn't look to be the query its a glitch in how I'm triggering a search.
Avatar of meno19

ASKER

Dammit i figured it out, bringing in the wrong number for the search
That confirms that the syntax is correct.  Maybe start with one clause first (the LIKE) and see if there are results.  Then add the latitude filter and see what's left, then add the last filter.