I am trying to match a numeric value that is purely numbers to another value in my database that is the same numbers but has symbols etc (it's phone numbers).
How can I get MySQL to only match the regexp of the mainNumber column (which has symbols etc in it) to my value (just numbers)?
Below is my code:
$SQL = "SELECT entities.name
FROM entities_main_numbers
LEFT JOIN entities ON entities.id = entities_main_numbers.entityId
WHERE mainNumber = ?
LIMIT 1";
E.g. +44 (0)800 123 123 to match against 440800123123