Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #8695

Re: why do I get a syntax error?

From Jerry Stuckle <jstucklex@attglobal.net>
Newsgroups comp.lang.php
Subject Re: why do I get a syntax error?
Date 2013-03-16 18:44 -0400
Organization A noiseless patient Spider
Message-ID <ki2si9$gs7$1@dont-email.me> (permalink)
References <whb767rvxtpg$.167pl8lnagxjt$.dlg@40tude.net>

Show all headers | View raw


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@attglobal.net
==================

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

why do I get a syntax error? richard <noreply@example.com> - 2013-03-16 17:32 -0400
  Re: why do I get a syntax error? The Natural Philosopher <tnp@invalid.invalid> - 2013-03-16 21:46 +0000
  Re: why do I get a syntax error? Doug Miller <doug_at_milmac_dot_com@example.com> - 2013-03-16 21:47 +0000
  Re: why do I get a syntax error? richard <noreply@example.com> - 2013-03-16 17:54 -0400
    Re: why do I get a syntax error? richard <noreply@example.com> - 2013-03-16 18:42 -0400
    Re: why do I get a syntax error? The Natural Philosopher <tnp@invalid.invalid> - 2013-03-17 02:25 +0000
      Re: why do I get a syntax error? "Beauregard T. Shagnasty" <a.nony.mous@example.invalid> - 2013-03-17 02:50 +0000
        Re: why do I get a syntax error? The Natural Philosopher <tnp@invalid.invalid> - 2013-03-17 09:43 +0000
          Re: why do I get a syntax error? Jerry Stuckle <jstucklex@attglobal.net> - 2013-03-17 10:04 -0400
    Re: why do I get a syntax error? "Beauregard T. Shagnasty" <a.nony.mous@example.invalid> - 2013-03-17 02:49 +0000
  Re: why do I get a syntax error? "Ralf S. Hellersen" <schneiderxr@arcor.de> - 2013-03-16 22:31 +0000
  Re: why do I get a syntax error? Jerry Stuckle <jstucklex@attglobal.net> - 2013-03-16 18:44 -0400
    Re: why do I get a syntax error? richard <noreply@example.com> - 2013-03-16 19:29 -0400

csiph-web