Re: Supplied argument is not a valid MySQL result resource...
| From: | Klaus Haberkorn | Date: | Sat, 21 Apr 2001 11:18:29 +0000 |
| Subject: | Re: Supplied argument is not a valid MySQL result resource... | ||
| References: | 1 2 3 4 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-8767@lists.php.net to get a copy of this message | ||
Looks like many reasons cause this error-message,
but I cannot find a problem in the Query:
ie.:
$db_handle = mysql_connect("localhost", "mysql", "mysql");
if($db_handle)
{
$result = mysql_db_query("mysql", "select * from user", $db_handle);
if($result = TRUE)
{
$row = mysql_num_rows($result);
(....)
The same simplified statement works fine in the Win32-client-tool,
connected as the same user.
The table "user" exists and "mysql" has any privileges from localhost and %
in "user" and "db"
I surely made some experiments with Caps or not.
I built a new apache 1.3.12 with a static php4.0.4pl1 module and
mysql-support.
Runs fine, but the problem is the same.
I have no more idea...
"Johannes Janson" <johannes.janson@gmx.de> schrieb in im Newsbeitrag:
9bhkqv$aai$1@toye.p.sourceforge.net...
> Hi,
>
> i don't get that.
> Examlpe: tablename: test , entry: id 001; name: John Doe
>
> $result = mysql_query("SELECT * FROM test");
> $row = mysql_fetch_whatever($result); // everything ok
>
>
> $result = mysql_query("SELECT * FROM tet");
> $row = mysql_fetch_wahtever($result); // Warning: Supplied arggument is
not
> a valid ....
>
> $result = mysql_query("SELECT nonexistent FROM test");
> $row = mysql_fetch_whatever($result); // Warning: Supplied argument is not
> ....
>
> $result = mysql_query("SELECT * FROM test WHERE id='002'");
> $row = mysql_fetch_whatever($result); // no errormsg, $result=true but
empty
>
> That's what I get. So there must be something wrong with the query.
>
> Johannes
>
>
> ""Klaus Haberkorn"" <hk@hknets.de> schrieb im Newsbeitrag
> news:9bhh1c$2gg$2@toye.p.sourceforge.net...
> > thank You, Johannes,
> > but I think we can skip this,
> > we reduced the query statement to the most simple one:
> > "SELECT * FROM {tablename}"
> > if the tablename is wrong, then another error message is issued.
> > the result is not treated by a while-loop but just by fetch_num_rows,
> > which at least reports the error.
> > (and, by the way, the same script runs on another system)
> > so we are more looking for problems with apache versions
> > and/or modules.
> > we also checked access-rights, but this also causes different errors.
> > any other idea?
> >
>
>
>
>
> --
> 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
>