mysqli_prepare()和mysqli_stmt_prepare()有什么区别?

时间:2015-07-16 18:49:12

标签: php mysqli

PHP手册的

This article在此使用mysqli_prepare(),但mysqli_stmt_*用于其他所有内容。

但是,在PHP手册的this article中,它使用mysqli_stmt_prepare()

这些有什么区别?我可以使用吗?如果mysqli_prepare()有效,那是否意味着mysqli_bind_param()有效?

好的,mysqli_bind_param() mysql_stmt_bind_param()表示它是mysqli_prepare()的别名。我认为可以安全地假设它与mysqli_*string QuoteMessageBody (MimeMessage message) { using (var quoted = new StringWriter ()) { quoted.WriteLine ("On {0}, {1} wrote:", message.Date.ToString ("f"), message.From.ToString ()); using (var reader = new StringReader (message.TextBody)) { string line; while ((line = reader.ReadLine ()) != null) { quoted.Write ("> "); quoted.WriteLine (line); } } return quoted.ToString (); } } 函数的其余部分相同吗?

1 个答案:

答案 0 :(得分:6)

mysqli_prepare()基本上只是

的快捷方式
$stmt = mysqli_stmt_init();
$stmt->prepare($sql);