我如何在mysql数据库中添加像括号[],单引号'双引号'这样的特殊字符[复制]

This question already has an answer here:

I can insert the special characters fine when using PHPmyAdmin, but it just doesn't work when inserting them via PHP. Could it be that PHP is changing the special characters into something else? If so, is there a way to make them insert properly?

$name = mysqli_real_escape_string($name); this is not work...
</div>

Usage of utf8 in database collation is required for storing the values.

1.) mysql_real_escape_string() - This will avoid up the SQL Injection.

2.) htmlspecialchars - This will prevent XSS attack.

You need to escape the quote, like so:

'Women\'s Development & Empowerment, Youth Affairs'