Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 1st, 2008, 03:34 PM
Registered User
 
Join Date: Jan 2008
Location: , , .
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.



Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 07:16 PM.


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