Re: syntax error, unexpected T_STRING

From: Date: Mon, 18 Jul 2005 19:20:42 +0000
Subject: Re: syntax error, unexpected T_STRING
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-218898@lists.php.net to get a copy of this message
* George B <geoizil@gmail.com> : > Jim Moseby wrote: > > > I am trying to connect to a datbase: > > > > > > " > > > mysql_select_db ('database') > > > or die ("couldnt connect to databse") > > > " > > > What is wrong here? > > > This is the error: > > > > > > Parse error: syntax error, unexpected T_STRING in file name on line 12 > > > > Extra spaces, and no semicolon? > > try: > > > > mysql_select_db('database') or die("couldnt connect to databse"); > > > Thanks JM! > It was another one of my usual mistakes :P > Forgot the semicolon. I don't underestand why you have to put in so many > semicolons... Hmm.. Is it a thing from C or something? C *AND* something... PHP borrows heavily from both C and perl (and a variety of other languages) -- both of which use this notation. Most languages I've used other than python use a delimiter to indicate the end of a statement (python does as well, technically -- the EOL character). -- Matthew Weier O'Phinney Zend Certified Engineer http://weierophinney.net/matthew/

« previous php.general (#218898) next »