Error: T_OBJECT_OPERATOR
I'm using this code from book Professional PHP Programming, starting in Chapter 9, page 167:
<?php
//Defining the Session class
class Session
{
// Define the Properties:
var $sqlhost='h50mysql47.secureserver.net';
var $sqluser='coopBulkOrder';
var $sqlpass='ABCabc123';
var $sqldb='coopBulkOrder';
var $linkid;
var $seshid;
var $sessdata;
var $err;
var $err_no;
var $expire_time=900; //length of time until expiration in seconds
var $userid;
// Define the Methods
function Session($this->seshid,$this->userid=0)
{
//connect to MySQL
$this->linkid=mysql_connect($this->sqlhost, $this->sqluser, this->sqlpass);
//verify connection made
if ($this->linkid) //was not able to connect
{
$this->err=mysql_error();
$this->err_no=101;
return;
}
my script continues beyond this point . . . .
When I do, I get this error:
Parse error: parse error, unexpected T_OBJECT_OPERATOR, expecting ')' in /home/content/e/s/p/esplin/html/SLSinfo/BulkOrder/classes/sessions.php on line 22
I have tried to do this in PHP5 by changing the file extension, as suggested by other forums. I have both php4 and php5 installed on the server.
Can someone help me identify the solution the the error? I believe the syntax is correct.
|