本文介紹了bind_param() 有什么作用?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!
問題描述
$resultSpendStmt = $connection->prepare(...);
$array->bind_param("sdidi", $A, $B, $C, $D, $E);
$array->execute();
$array->store_result();
$array->bind_result($F, $G, $H, $I, $J, $K);
我仍然有點(diǎn)不確定 bind_param 的作用.有人可以舉個例子來說明什么是意思嗎?
I am still a little unsure what bind_param does. Can someone give me an example as to what is means?
推薦答案
在準(zhǔn)備 SQL 語句時,可以在列值所在的位置插入占位符 (?
),然后使用 bind_param()
以安全地將該占位符替換為實(shí)際列的值.這可以防止 SQL 注入的任何可能性.
When you prepare an SQL statement, you can insert a placeholder (?
) where a column value would go, then use bind_param()
to safely substitute that placeholder for the real column's value. This prevents any possibility of an SQL injection.
您可以在此處閱讀有關(guān) bind_param() 的更多信息.一個>
這篇關(guān)于bind_param() 有什么作用?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!