ID: 40377 Updated by: [EMAIL PROTECTED] Reported By: burg1 at gmx dot net -Status: Open +Status: Closed Bug Type: Documentation problem PHP Version: Irrelevant New Comment:
This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. "For SELECT, SHOW, DESCRIBE, EXPLAIN and other statements returning resultset, ..." Previous Comments: ------------------------------------------------------------------------ [2007-02-06 23:05:19] burg1 at gmx dot net Sorry for the original post - I've just noticed that this feature is already implemented ;-) So this feature request transforms into a documentation problem: mysql_query() doesn't only return a resource for SELECT, SHOW, DESCRIBE or EXPLAIN commands (as stated in the docs), but also for other types of commands which return an output - at least for ANALYZE TABLE and OPTIMIZE TABLE (don't know if there exist other MySQL commands like this) Code to check: $result = mysql_query("ANALYZE TABLE tablename"); print_r (mysql_fetch_row($result)); ------------------------------------------------------------------------ [2007-02-06 21:21:13] burg1 at gmx dot net Description: ------------ Currently, the mysql_query() function returns a resource only on some commands (SELECT, SHOW, DESCRIBE or EXPLAIN). On any other command, it just returns TRUE. My suggestion: Let the function return the actual MySQL output on those "other commands" (I'm talking about commands like ANALYZE TABLE that do generate an output). Could be given as an associative array, or if that's not possible, just as a string. This way, mysql_query would return: *) a resource on SELECT, SHOW, DESCRIBE or EXPLAIN *) an array/string on commands that give an output (OPTIMIZE TABLE, etc.) *) TRUE on commands that don't give an output (DELETE, etc.) *) FALSE on error ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=40377&edit=1