RE: [PHP] Solved! mysql_connect() - but mysql_result problem occurs
| From: | Feroze Md. Arif | Date: | Tue, 12 Dec 2000 23:36:03 +0000 |
| Subject: | RE: [PHP] Solved! mysql_connect() - but mysql_result problem occurs | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-29982@lists.php.net to get a copy of this message | ||
Hi,
I don't know if this will help but here goes:
I used to get this error when I had a series of queries to be executed and I
was copying and pasting the queries one below the other. Invariably I would
forget to change the name of the result variable returned by the
mysql_db_query() (Different names for the result variables are not required
I think but it sort of helps keep my code readable) leading to the error
"Warning: Supplied argument is not a valid MySQL result resource in
test.php on line XX"
So please do check that the correct result variable is being used and as a
precaution perhaps you could use different variable names for results from
different queries :)
Regards
Feroze
-----Original Message-----
From: Ignacio Vazquez-Abrams [mailto:ignacio@openservices.net]
Sent: Wednesday, December 13, 2000 2:09 AM
To: Rino Mardo
Cc: php-general@lists.php.net
Subject: Re: [PHP] Solved! mysql_connect() - but mysql_result problem
occurs
On Tue, 12 Dec 2000, Rino Mardo wrote:
> On Tue, Dec 12, 2000 at 12:31:39PM -0500 or thereabouts, Ignacio
Vazquez-Abrams wrote:
> <...snipped...>
> > >
> > > </body>
> > > </html>
> > >
> >
> > Quick question: Does the userid test have select rights on mydb?
> >
> i think so. here's what i did:
>
> mysql> insert into
> -> host(host,db,Select_priv, Insert_priv, Update_priv,
> -> Delete_priv, Create_priv, Drop_priv)
> ->
> values('localhost','%','Y','Y','Y','Y','Y','Y');
>
>
> mysql> insert into
> -> user (host, user, password)
> -> values('localhost','test',password('test'));
>
> mysql> insert into
> -> db (host,db,user,Select_priv, Insert_priv, Update_priv,
> Delete_priv, Create_priv, Drop_priv)
> -> values
>
> ('localhost','test','test','Y','Y','Y','Y','Y','Y');
Is that correct? ^^^^
> i've also reloaded mysql to make sure.
>
--
Ignacio Vazquez-Abrams <ignacio@openservices.net>