user880789 user880789 - 2 years ago 126
SQL Question

PHP Error: Mysqli_real_escape_string() expects exactly 2 parameters, 1 given

if (phpversion() >= '4.3.0'){
$string = mysqli_real_escape_string($string);
$string = mysqli_escape_string($string);

All the documentation for
seems to indicate this is a valid bit of code - don't understand?

Answer Source

Documentation saying two parameters: string mysqli_real_escape_string ( mysqli $link , string $escapestr ).

The first one is a link for a mysqli instance, the second one is the string to escape.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download