如何在mysql查询中处理单引号

Pus*_*tal 1 php mysql

我在php工作.我想写这样的查询: -

update user_account set university_name='St. Josed father's institute' 
where userId=5;
Run Code Online (Sandbox Code Playgroud)

但是这是由于制造误差手段,因为单引号的创建问题".

请建议我如何处理这个问题.目前我是正确的这个直接圣Josed父亲的研究所, 但在我的PHP代码中这是变量$ university_name

所以请建议我如何检查并删除此类问题.

abc*_*483 12

$location = "St. Josed father's institute";
$location = mysql_real_escape_string($location);
Run Code Online (Sandbox Code Playgroud)