Parse error when using global
| From: | accepto | Date: | Wed, 18 Sep 2002 17:05:08 +0000 |
| Subject: | Parse error when using global | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-21831@lists.php.net to get a copy of this message | ||
Hallo everybody,
I do have a little problem and can't come up with an answer. Can somebody
help me?
I would like to use two variables in a function, $database_viva and $viva.
$database_viva = "test";
$username_viva = "xxxx";
$password_viva = "xxxx";
$viva = mysql_pconnect($hostname_viva, $username_viva, $password_viva) or
die(mysql_error());
365 function show($typ,$id)
366 {
367 global $database_viva,$viva;
368 //Datensaetze auswaehlen
369 mysql_select_db($database_viva, $viva);
I receive this error message on my local system (Windows XP,PHP Version
4.2.3)
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting
T_VARIABLE or '$' in d:\projekte\viva_neu\tmpggi4z2n7s1.php on line 367
But the script runs without a problem on the remote system (Unix,PHP 4.1.2)
If I uncomment the 'global line' it is working local, but I get an error
message on the remote system???
365 function show($typ,$id)
366 {
367 //global $database_viva,$viva;
368 //Datensaetze auswaehlen
369 mysql_select_db($database_viva, $viva);
Thanks for your help in advance,
Claudia