I'm working on a search feature to search for model numbers and I'm trying to get MySQL to show me results similar to what I'm asking for but LIKE %$var% doesn't do it.
Example (we'll call table, "tbl_models"):
id model
+-------+--------------------+
| 1 | DV6233SE |
| 2 | Studio 1440 |
| 3 | C762NR |
+-------+--------------------+
When searching using a search box I'm currently using:
SELECT id, model FROM tbl_models WHERE model LIKE %$var% ORDER BY id DESC
If I search for "C7" it'll return "C762NR" which is fine, but say I were to search for "C760" or "C700" or a typo of "C726NR"? Is there a way in MySQL (or PHP, JS, jQuery) that I can expand the limit of what results are returned to include different variations or close matches?
I'm not looking for someone to write it for me either, just a push in the right direction would be very helpful!