你查一下MySQL的手册,关于mysql_real_connect一段:CLIENT_MULTI_RESULTS Tell the server that the client can handle multiple result sets from multiple-statement executions. This is automatically set if CLIENT_MULTI_STATEMENTS is set. See the note following this table for more information about this flag. Added in MySQL 4.1. If you enable CLIENT_MULTI_STATEMENTS or CLIENT_MULTI_RESULTS, you should process the result for every call to mysql_query() or mysql_real_query() by using a loop that calls mysql_next_result() to determine whether there are more results. For an example, see Section 17.2.9, “C API Handling of Multiple Statement Execution”. 说实话,我也从来没有用过这个flag,所以不知道具体情况。
在使用存储过程的时候,传统的MYSQL系列函数,没有MYSQLI好用.
你可以看看mysql手册里的mysql_real_connect()
CLIENT_MULTI_RESULTS 通知服务器,客户端能够处理来自多语句执行或存储程序的多个结果集。如果设置了CLIENT_MULTI_STATEMENTS,将自动设置它。
因为php里未予定义该常量,因此需要自己定义。