比如我的sql语句是
INSERT INTO `man_db_write`.`man_articles` (`title`,`content`,`created`) VALUES (:0_title,:0_content,:0_created),(:1_title,:1_content,:1_created)
然后我再PHP中绑定变量
$stmt->bindParam(':0_title','title 1'); $stmt->bindParam(':0_content','content 1'); $stmt->bindParam(':0_created','1418103633'); $stmt->bindParam(':1_title','title 2'); $stmt->bindParam(':1_content','content 2'); $stmt->bindParam(':1_created','1418103635'); $stmt->execute();
这样批量插入数据的方法科学吗?
比如我的sql语句是
INSERT INTO `man_db_write`.`man_articles` (`title`,`content`,`created`) VALUES (:0_title,:0_content,:0_created),(:1_title,:1_content,:1_created)
然后我再PHP中绑定变量
$stmt->bindParam(':0_title','title 1'); $stmt->bindParam(':0_content','content 1'); $stmt->bindParam(':0_created','1418103633'); $stmt->bindParam(':1_title','title 2'); $stmt->bindParam(':1_content','content 2'); $stmt->bindParam(':1_created','1418103635'); $stmt->execute();
这样批量插入数据的方法科学吗?
鸟哥~
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号