I have an article
in MySQL which has a title
column. Now the title column for a specific article id
has characters You’
. When I query this article PHP does not return anything at all and the screen is completely blank. "View source" also doesn't show anything.
Here is the code:
static function getArticle($params)
{
$id=$params['article_id'];
$queryv = "SELECT * FROM 'articles WHERE `article_id`='{$id}'";
$resultv = mysql_query($queryv) or die(json_encode(mysql_error()));
if (mysql_num_rows($resultv) > 0)
{
$row = mysql_fetch_assoc($resultv);
$title=strtoupper($row['article_title']);
$body=$row['article_body'];
return(array('article_id'=>$row['article_id'],
'article_body'=>"<h3 style='width:100%;text-align:center;'>$title</h3>$body",
'article_title'=>$row['article_title'],
'article_author'=>$row['article_author'],
'article_image'=>$row['article_image'],
'article_share_link'=>$row['article_share_link'],
'article_author_image'=>$row['article_author_image'],
));
}
}
I'm using utf8mb4_general_ci
as collation in MySQL. phpmyadmin does return the correct result.
I did search online before posting this question but nobody had this problem of getting absolutely no response.