Re: Not a valid MySQL result resource
| From: | Miles Thompson | Date: | Fri, 09 Nov 2001 02:31:56 +0000 |
| Subject: | Re: Not a valid MySQL result resource | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-14169@lists.php.net to get a copy of this message | ||
I'd check for mysql_num_rows( $result_query) > 0 as well.
It's entirely possible the user mis-typed the login or password values.
Miles
At 07:26 PM 11/8/01 -0600, Paul DuBois wrote:
At 2:04 AM +0100 11/9/01, MPropre wrote:<?php //.../... first part of the code is to connect to the right DB on a MySQL server. It works fine //This code to show the query. It runs well under MySQL and gives 1 result : $query="SELECT Login, Password FROMNot so fast. Where's your error checking to verify that the query actually succeeded? if (!$result_query) {userWHERE user.login=''$login'' and user.password=''$password''"; //This var should contain a query result ressource: $result_query=mysql_query($query); //Here's my error message after executing:die ("Gee, I guess error checking is a good thing after all!" . mysql_error ());}// Supplied argument is not a valid MySQL result resource in this line: $result_table=mysql_fetch_array($result_query); // I thought that this var ($result_table) should contain the row of 2 cells //And I expected to read $result_table['login'] or $result_table[0] as the first cell of the row... // I any of you can help me, poor php newby... :o) Great thanks !! ?> -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net For additional commands, e-mail: php-db-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net For additional commands, e-mail: php-db-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net