I’m working on a code that provide basic information about the place you live in, in the Netherlands.
There for i need the ‘id’ from a zip code that can vary between zip A (1234) of zip B (1236). Those begin and end numbers are already in the database. But I failed to get the id, because i’m getting an error with the SQL syntax.
I have tried to do the following:
SELECT `id` WHERE `9291` BETWEEN 'zipA' AND 'zipB'
SELECT `id` WHERE `zipA` > '9291' OR `zipB` < '9291'
SELECT `id` WHERE `zipA` > '9291' AND `zipB` < '9291'
What could i do to make this work? I’m just a beginner with MYSQL and php, i’m currently working with CodeIgniter 2.1.0
Thank you very much!
A couple of things:
looks to me like you are trying to compare the column
9291to thestring values ‘zipA’ AND ‘zipB’.
idFROM ?Could you please try something like this: