Page 1 of 1

Why is the Parse error displaying?

Posted: Sun Jan 07, 2007 5:08 pm
by JB1958
Greetings fellow programmers,

The following two (2) scripts are part of a software package that have been running perfectly on an Apache server for several years.

Code: Select all

<?php
/**
 *  This is the dbconnection script
 */ 
$Query = mysql_connect ("dbhostname", "dbusername", "dbpassword") or die ("WXYZ is not available at the moment.  Please try again later.");
mysql_select_db("dbusername", $Query);
?>

Code: Select all

<?php
/**
 *  This file loads the admin variables into an array called 'g_admin' for reuse
 *  And load the current time into the variable $g_time
 */ 
require "dbconnection.php";

$g_admin_query = mysql_query("SELECT * FROM admin", $Query);
$g_admin = mysql_fetch_array($g_admin_query);
$g_time_query = mysql_query("SELECT UNIX_TIMESTAMP() FROM admin", $Query);
$g_time = mysql_result($g_time_query, 0, 0);

?>
I am new to Linux. I recently loaded the entire software package onto a server running Linux and the following displays...
Parse error: parse error, unexpected T_VARIABLE in /www/path/to/the/php/script/dbconnection.php on line 1

The dbhostname,dbusername,dbpassword,WXYZ,/www/path/to/the/php/script/ have been changed to protect the innocent.

Why is the Parse error displaying?

Thank you in advance for your time and consideration.

JB1958

Posted: Sun Jan 07, 2007 5:19 pm
by feyd
The posted code doesn't appear to have an error, but that doesn't mean there isn't one. It just means your post doesn't suggest anything.

If you could post the real files (only removing the the host/user/password) it could help more.