陈刚2018-03-06 14:39:05
You need to use the fetchAll() function to obtain the query results. You have only executed the query and have not obtained the query results!
辉2018-03-05 21:45:11
mysql_query() only returns a resource for SELECT, SHOW, DESCRIBE, EXPLAIN and other statements. If there is an error in the query, it returns FALSE.
The return value should be a resource object, and you can use foreach to read the content. If the return value is false, it means that your sql statement is wrong. Of course, this prompt will appear in the connect sucess after connecting to the database in your code. If this step does not appear, it means that your database connection has not been successful. It may be that the user name and password of the database are incorrect, or the database service is not turned on. Find it yourself.