2016-07-20 64 views

回答

0

您可以插入特殊字符與PDO.Lets採取與例子看看:

<?php 
$conn = new PDO('mysql:host=localhost;dbname=form', $username, $password); 

/* Complex string */ 
$string = "Co'mpl''ex \"st'\"ring"; 
print "Unquoted string: $string\n"; 
print "Quoted string: " . $conn->quote($string) . "\n"; 
?> 
1

使用addslashes代替mysql_real_escape_string()

相關問題