I have a database that stores the users name, number, and carrier in a table called user.
I need to know how to write a query that if my value is equal to name – it will fetch the number and carrier associated with that name. I am writing this in php and will use javascript if necessary.
I should prefer you to use “SELECT * FROM user WHERE name LIKE ‘{$value}'”
because using = will search for the exact value
For example: if in database the value is john and u searched for John it will not display the result but if you use LIKE it will display all the related results like JOHN, john, John, jOHN etc.
Thanking You,
Megha