I want to have a string with the char ‘ in it, without having it closing the string:
$title = "google";
$link = "www.google.com";
$val_str = "'" . $title . "'," . $link . "'";
$query = "INSERT INTO MY_TABLE (title,link) . VALUES (" . $val_str . ")";
so that $val_str will have: 'google', 'www.google.com'
in it.
how can i do it?
You can use a backslash to escape the
'character in your string: