RE: [PHP] Why am I getting this error?
| From: | Maxim Maletsky \(PHPBeginner.com\) | Date: | Wed, 10 Oct 2001 14:14:12 +0000 |
| Subject: | RE: [PHP] Why am I getting this error? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-70666@lists.php.net to get a copy of this message | ||
Change
\"$tradeInfo[trade_to_uid]\"";
to
\"{$tradeInfo['trade_to_uid']}\"";
Regards,
Maxim Maletsky
www.PHPBeginner.com
> -----Original Message-----
> From: Boget, Chris [mailto:Chris.Boget@wild.net]
> Sent: mercoledì 10 ottobre 2001 16.11
> To: Php (E-mail)
> Subject: [PHP] Why am I getting this error?
>
>
> I've been beating my head up against the wall with this one
> for an hour and I cannot figure out what is going wrong... :(
>
> Each line of code below should be on a single line. The code
> starts at line 115 and ends at line 133.
>
> $fromUserQuery = "SELECT * FROM logins WHERE name =
> \"$tradeInfo[trade_from_uid]\""; $fromUserResult =
> mysql_db_query( "vtes", $fromUserQuery, $link );
> $fromUserInfo = mysql_fetch_array( $fromUserResult );
>
> $toUserQuery = "SELECT * FROM logins WHERE name =
> \"$tradeInfo[trade_to_uid]\"";
> $toUserResult = mysql_db_query( "vtes", $toUserQuery, $link );
> $toUserInfo = mysql_fetch_array( $toUserResult );
>
> mysql_close( $link );
>
> $mailToUsers = array();
> if( "$toUserInfo[trades_notification]" ) {
> $mailToUsers[] = "\"$toUserInfo[name]\" <$toUserInfo[]email>";
>
> }
> if( "$fromUserInfo[trades_notification]" ) {
> $mailToUsers[] = "\"$fromUserInfo[name]\" <$fromUserInfo[email]>";
>
> }
>
>
> When I try to run my script, I get the following error:
>
> Parse error: parse error, expecting `T_STRING' or
>
T_VARIABLE' or T_NUM _STRING' in ./parse_email.php on
> line 126
>
> Line 126 is this one:
>
> if( "$toUserInfo[trades_notification]" ) {
>
> however, even if I change it to
>
> if( 1 == 1 ) {
>
> I get the same error.
> What's going on?!?
>
> Chris
>