Why is the Parse error displaying?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
JB1958
Forum Newbie
Posts: 1
Joined: Sun Jan 07, 2007 5:03 pm

Why is the Parse error displaying?

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
Post Reply