I have a db table that contains some business names.
I need to query by name and usually have no problems unless the name contains an apostrophe.
("
SELECT*
FROM t1
WHERE bus_name = '".$busName."'
")
I've experimented and tried using static value, like this:
("
SELECT*
FROM t1
WHERE bus_name = \"Bob's store\"
")
and it worked. Tried:
("
SELECT*
FROM t1
WHERE bus_name = \"".$busName."\"
")
and it doesn't. What am I missing?