PHP multiple MYSQL commands in one mysql_query() query [duplicate]

久未见 提交于 2019-11-29 05:19:05
$query = "INSERT INTO `users` VALUES (1,'stack','overflow'), ('other','stack','overflow');";
mysql_query($query);

PHP does not support sending more than one query at a time via mysql_query, but you can achieve your result in a single one by using the above.

according to http://www.php.net/manual/en/function.mysql-query mysql_query() sends a unique query (multiple queries are not supported) to the currently active database on the server that's associated with the specified link_identifier.

but this guy said that you just have to pass flag 65536 as mysql_connect's 5 parameter http://www.php.net/manual/en/function.mysql-query.php#91669

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!