Re: syntax error, unexpected T_STRING

From: Date: Mon, 18 Jul 2005 18:25:22 +0000
Subject: Re: syntax error, unexpected T_STRING
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-218892@lists.php.net to get a copy of this message
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 this code works though
$db = mysql_connect("localhost", "myaccount", "mypass") or die("Could not connect."); if(!$db) die("no db"); if(!mysql_select_db("database",$db)) die("No database selected.");

« previous php.general (#218892) next »