Re: why do I get a syntax error? [message #180759 is a reply to message #180753] |
Sat, 16 March 2013 22:44 |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma:
|
Senior Member |
|
|
On 3/16/2013 5:32 PM, richard wrote:
> if (!$con) { die ("can not connect: " . mysql_error()};
>
> generates "Parse error: syntax error, unexpected '}' "
> i have checked for matching brackets and other obvious syntax errors.
>
Rewrite it with sensible formatting (as you should ALL your code):
if (!$con) {
die ("can not connect: " . mysql_error()
};
You're missing both a right paren and a semicolon.
And the semicolon AFTER the right brace is superfluous.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|