Re: [PHP] syntax error, unexpected T_STRING
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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Extra spaces, and no semicolon? try: mysql_select_db('database') or die("couldnt connect to databse"); JM 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? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] syntax error, unexpected T_STRING
George B 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 Are either one of those lines, line 12? -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] syntax error, unexpected T_STRING
> > 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 > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > Extra spaces, and no semicolon? try: mysql_select_db('database') or die("couldnt connect to databse"); JM -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] syntax error, unexpected T_STRING
> 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? When I see that T_STRING error, missing semicolon is the first thing I look for. I don't know the history of the semicolon, but I imagine the need for them is rooted in the necessity for PHP to know where a line of code ends and the next one starts. Just a guess. ;o) JM -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] syntax error, unexpected T_STRING
* George B <[EMAIL PROTECTED]> : > 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/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php