Reputation: 23
I am little stuck today trying to convert double quote into single quote.
I got this:
$string=" WHERE news_cat='$catid' AND news_title LIKE '%$searchnews%'";
I did this but it didn't work:
$string = ' WHERE `news_cat` = \'' . $catid . '\' AND `news_title` LIKE '%$searchnews%'';
Upvotes: 0
Views: 114
Reputation: 30131
You also need to escape the last single quotes:
LIKE \'%'.$searchnews.'%\'';
Upvotes: 1