Re: Re: Help please
| From: | webmaster at kyid dot net | Date: | Tue, 10 Apr 2001 11:35:17 +0000 |
| Subject: | Re: Re: Help please | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-8429@lists.php.net to get a copy of this message | ||
> I assume that the username field is text. You need to add single quotes
> around the field.
>
> $validate = mysql_query("SELECT username, user_password FROM users
> WHERE username='".$uname."'",$db);
>
Actually, it did help, and it didn't ;p
It would seem there is a scoping issue with the $db parameter. its giving a
not valid SQL-link because it no longer sees the db connection. It has to
do with the way the page calls itself I think... though it isn't very clear
to me. If I include the connect code for the db in the else block it
connects fine, and the simple select I have in the code sample works. But I
don't wanna have the db connect code in there if possible...I want the
connect code in one file only, and included on the header for the page...oh
well :)
If I figure out what is happening I will post it to this list.
Thanks for helping,
Keith.
> OR simply:
>
> $validate = mysql_query("SELECT username, user_password FROM users
> WHERE username='$uname'",$db);
>
> Hope this helps.
>
> Dan
>
> --
> 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
>
>
>