日期:2014-05-16 浏览次数:20560 次
$conn = new mysqli('localhost','root','123','zx','3306');
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
$prepare = $conn -> prepare("INSERT INTO test (uid,name) VALUES('?','?')");
$num = 12;
$hanzi = "xiha";
$prepare -> bind_param('is',$num,$hanzi);
$prepare -> execute();