使用MySQLi在PHP中进行多个预处理语句(Multiple Prepared statements in PHP with MySQLi)
我想做两个准备好的语句,一个在PHP中使用MySQLi一个接一个。 我是PHP和MySQLi的新手,所以我不知道是否应该关闭语句,关闭数据库连接,将所有代码放在函数中,或者只是让代码不在函数中。
基本上我只想插入一个记录到一个表中,然后使用MySQLi将相同的记录插入到另一个表中。
谢谢!
I want to do two prepared statements, one right after the other in PHP with MySQLi. I am a novice at PHP and MySQLi so I don't know whether I should close the statement, close the database connection, put all of the code in a function, or just have code not inside a function.
Basically I just want to insert a record into one table and then insert the same record into another table using MySQLi.
Thanks!
原文:https://stackoverflow.com/questions/9640396
更新时间:2022-02-18 16:02