Re: Best way to figure out whether a query returns RESULT or NON-RESULT
| From: | Chris | Date: | Sat, 16 Oct 2004 06:00:46 +0000 |
| Subject: | Re: Best way to figure out whether a query returns RESULT or NON-RESULT | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-199626@lists.php.net to get a copy of this message | ||
Karam Chand wrote:
Hello, I have an app where one module is similar to phpMyAdmin (well only .1%) with error_reporting() set to E_ALL. Now a user can execute any query. What is the best way to know whether a query is result or non-result. e.g. . . .
Thanks in advance Regards, KaramAs it states on http://www.php.net/mysql_query : " Only for SELECT,SHOW,EXPLAIN or DESCRIBE statements *mysql_query()* returns a resource identifier or *FALSE* if the query was not executed correctly. For other type of SQL statements, *mysql_query()* returns *TRUE* on success and *FALSE* on error. A non-*FALSE* return value means that the query was legal and could be executed by the server." So , (false !== $result) means the query was sucessful , and if it was successful (true === $result) would mean that no rows were returned. Chris