RE: [PHP] Can you find the parse error?
| From: | Eric Kilgore | Date: | Fri, 29 Mar 2002 22:53:40 +0000 |
| Subject: | RE: [PHP] Can you find the parse error? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-90729@lists.php.net to get a copy of this message | ||
Good to know I'm not going crazy. I found the error in the previous
function. I failed to end an echo statement and the next quote on that page
was this statement. Doh.
-----Original Message-----
From: Miguel Cruz [mailto:mnc@stoic.net]
Sent: Friday, March 29, 2002 2:08 PM
To: Eric Kilgore
Cc: php-general (E-mail)
Subject: Re: [PHP] Can you find the parse error?
On Fri, 29 Mar 2002, Eric Kilgore wrote:
> What's wrong with this code that it would give this error?
>
> Parse error: parse error, expecting
','' or
> ';''
>
> $query = "INSERT INTO tblUserInfo (UserID, Complex, Contact, Address,
State,
> City, Zip, Phone,
> Fax, email, fee) VALUES ('".$UserID."',
> '".$Complex."', '".$Contact."',
> '".$Address."',
> '".$State."', '".$City."',
> '".$Zip."', '".$Phone."', '".$Fax."',
> '".$email."', '".$fee."')";
>
> I think I've been staring at it too long. I can't find it.
I don't see an error, but wouldn't it be easier (and faster) to write:
$query = "INSERT INTO tblUserInfo (UserID, Complex, Contact, Address,
State, City, Zip, Phone, Fax, email, fee) VALUES ('$UserID', '$Complex',
'$Contact', '$Address', '$State', '$City',
'$Zip', '$Phone', '$Fax',
'$email', '$fee')";
without all the concatenation?
miguel
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php