So i have done inserts using mysql_real_escape_string but now i cant seem to figure out how to do a “like” search for those records…
any help would be appreciated. maybe there is a better way to do this?
so simple example would be:
in the DB record there is foo’ bar.
now i want to search for foo bar or foo’ bar as a like but i keep getting a mysql error.
$term = "foo' bar";
$sql = mysql_query("SELECT * FROM artists WHERE artist_name LIKE '%$term%'") or die ( mysql_error() );
Also would like to know if the record in the table is set to” foo’ bar” how can I search for just “foo bar” in a LIKE
Nooooooooo! don’t use mysql. Use pdo.