gpt4 book ai didi

php - 你应该只使用准备好的语句来转义吗?

转载 作者:可可西里 更新时间:2023-11-01 07:03:37 25 4
gpt4 key购买 nike

<分区>

我看到很多人说您应该始终使用准备好的语句进行数据库查询。但是,PHP 文档说:

Every prepared statement occupies server resources. Statements should be closed explicitly immediately after use. If not done explicitly, the statement will be closed when the statement handle is freed by PHP.

Using a prepared statement is not always the most efficient way of executing a statement. A prepared statement executed only once causes more client-server round-trips than a non-prepared statement.

来自 http://php.net/manual/en/mysqli.quickstart.prepared-statements.php

鉴于上述情况,如果您只打算使用一次查询,使用准备好的语句不是更好吗?

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com