1

Inside my database table called Postcodes I have rows like AB10 1AB, AB10 2AB

so when I'm pulling them to access a dynamic page they're appearing in the URL like AB10%201AB obviously because or being URL encoded, now how can I set the URL to just AB101AB and then still access the database row using AB101AB?

in brief, I want to access a row inside a database which has a value of AB10 1AB using AB101AB

something like

SELECT 
    * 
FROM 
    `Postcodes` 
WHERE 
    `postcode` = REMOVEWHITESPACES FROM `postcode` ROW('AB101AB')
1

1 Answer 1

1

Use the replace() function (reference here):

select *
from `Postcodes`
where replace(`postcode`, ' ', '') = 'AB101AB'
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.