Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 1st, 2008, 03:34 PM
Registered User
 
Join Date: Jan 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.








Similar Threads
Thread Thread Starter Forum Replies Last Post
Parse error: syntax error, unexpected T_ELSE in /h vipin k varghese BOOK: XSLT Programmer's Reference, 2nd Edition 4 September 29th, 2011 01:19 AM
Insert Query Error & Run-Time Error 3022 DavidWE Access 1 July 31st, 2008 11:17 AM
Ch 4: Parse error: syntax error, unexpected T_SL hanizar77 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 0 June 23rd, 2008 09:17 PM
[Resolved] Error calling a sp - parameter error snufse .NET Framework 2.0 2 February 12th, 2008 04:46 PM
VB Error: Syntax Error or Access Violation codehappy VB How-To 7 October 3rd, 2007 05:41 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.