Single quotes inside double quoted string (Was: Re: [PHP] Re: Problem with a class... any help will be appreciated.)
| From: | John W. Holmes | Date: | Thu, 29 Apr 2004 11:16:21 +0000 |
| Subject: | Single quotes inside double quoted string (Was: Re: [PHP] Re: Problem with a class... any help will be appreciated.) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-184937@lists.php.net to get a copy of this message | ||
From: "Marius Dascalu" <mariusdascalu2003@yahoo.com>
> I think the error is in line:
>
> $query_revisa = $this->dbQuery("SELECT User, Password,
> Nivel FROM Admon WHERE User = '$user'");
>
> PHP doesn't expand variables in single quoted
> expressions. Try this line instead:
>
> $query_revisa = $this->dbQuery("SELECT User, Password,
> Nivel FROM Admon WHERE User = $user");
Take a look at that first line again. The string is delimited by DOUBLE
QUOTES. The single quotes are inside of the string. PHP will resolve the
variable because the string has double quotes, so this isn't the problem.
Sorry I can't help the OP as to what the actual problem is, but I wanted to
point out this misconception.
---John Holmes...