Jump to content

Why is the Parse error displaying?


JB1958

Recommended Posts

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=php:0]<?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]


[code=php:0]<?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);

?>[/code]


I am new to Linux.  I recently loaded the entire software package onto a server running Linux and the following displays...
[B]Parse error:[/B] 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
Link to comment
https://forums.phpfreaks.com/topic/33261-why-is-the-parse-error-displaying/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.