delete from member where userid=48;delete from product where userid=48
这么写,我在PhpMyAdmin里执行,可以删除掉。
但在程序里不能,例如:
$conn->sql = "delete from member where userid=48;delete from product where userid=48";
$conn->execute();
这是为什么?
我的意思就是将很多SQL语句,连接起来,最后一次执行
还有好的办法吗??
谢谢
这么写,我在PhpMyAdmin里执行,可以删除掉。
但在程序里不能,例如:
$conn->sql = "delete from member where userid=48;delete from product where userid=48";
$conn->execute();
这是为什么?
我的意思就是将很多SQL语句,连接起来,最后一次执行
还有好的办法吗??
谢谢
不然sql注入更加频繁
queryphp 简单 MVC ORM框架
---------------------------------------------
http://topic.csdn.net/u/20100310/11/62a60067-b3da-4dee-9d6a-f1baeb2f3f33.html
这只是phpmyadmin自己自动识别了
lz若真想一次执行多个sql语句 可采用存储过程来实现
可以执行多条sql
好像可以执行多条语句,我记得以前是不行的
mysql5.1
http://dev.mysql.com/doc/refman/5.1/en/c-api-multiple-queries.html
queryphp 简单 MVC ORM框架
---------------------------------------------
http://topic.csdn.net/u/20100310/11/62a60067-b3da-4dee-9d6a-f1baeb2f3f33.html
delete from member where userid in(48,49)