Re: Not a Valid MySQL-Link Resource
| From: | Stephen | Date: | Sat, 19 Oct 2002 20:33:27 +0000 |
| Subject: | Re: Not a Valid MySQL-Link Resource | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-120624@lists.php.net to get a copy of this message | ||
Here's $main:
$main = mysql_pconnect($hostname_main, $username_main, $password_main) or
die(mysql_error());
I won't give the user, host, pass, etc for obvious reasons. I'm connecting
to the database jsut fine though.
----- Original Message -----
From: "John Nichel" <jnichel@by-tor.com>
To: "Stephen" <webmaster@melchior.us>
Cc: "PHP List" <php-general@lists.php.net>
Sent: Saturday, October 19, 2002 3:33 PM
Subject: Re: [PHP] Not a Valid MySQL-Link Resource
> What's $main? What does you connection string look like?
>
> Stephen wrote:
> > Hello,
> >
> > I'm having some trouble understanding this error I'm getting. Here's the
error:
> >
> > Warning: mysql_query(): supplied resource is not a valid MySQL-Link
resource in c:\phpdev5\www\newsletter\index.php on line 38
> >
> > Now here's the block of code that goes into the query:
> >
> > $key = $HTTP_GET_VARS['key'];
> > $email = $HTTP_GET_VARS['email'];
> > $sql = "SELECT * FROM users WHERE key='$key' AND
> > email='$email'";
> > $query = mysql_query($sql, $main);
> >
> > Please help!
> >
> >
> > Thanks,
> > Stephen Craton
> > http://www.melchior.us
> > http://php.melchior.us
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>