Current location: Hot Scripts Forums » Programming Languages » PHP » Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or }

Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or }

Reply
  #1 (permalink)  
Old
Newbie Coder
 
Join Date: May 2009
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Question Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or }

Hello guys.

I see there is a few threads on this subject but i have this problem the code looks ok to me but i'm not really up to scratch with functions or classes. this is the error...

Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/site/public_html/pfp/magazine/db.php on line 6

:queasy::queasy:

here is the code.

config.php
PHP Code:

<?php

// ADMIN SETTINGS //
define ("ADMIN_PASSWORD""PASS");                    //  Admin Password
define ("WEBSITE_NAME""Flash Page Flip");                    //  Your Website Name                    

// MySQL SETTINGS //
define ("HOST","localhost");                            //  database host
define ("USR""user");                            //  database username
define ("PSW""pass");                            //  database password
define ("DB""cms");                            //  database to use

// E-MAIL SETTINGS //
define ("MAIL_FROM_NAME","website admin");             //  Sender Name
define ("MAIL_SENDER_EMAIL","sender@example.com");            //  Sender E-mail
define ("MAIL_SENDER_USERNAME","sender@example.com");        //  Sender E-mail Username
define ("MAIL_SENDER_PASSWORD","youremailpassword");        //  Sender E-mail Password
define ("MAIL_SERVER","mail.example.com");                //  Sender Mail Server
define ("CHAR_SET","8859-1");                        //  Mail Character Set Code
define ("STF_SUBJECT","Check This Out");                //  Tell a Friend Mail Subject
define ("STF_LINK","www.example.com");            //  Your Publication Link For Tell a Friend
define ("LOST_PASSWORD_SUBJECT","Your Login Information");    //  Lost Password Mail Subject

?>
db.php

PHP Code:

<?php
require_once("config.php");

class 
db_layer
{
    private 
$conn;
    function 
__construct() 
    {
    }

    public function 
getConnection()
    {
        if(
$this->conn == "")
        {
           
$conn mysql_connect(HOST,USR,PSW);
           
mysql_select_db(DB);
           
mysql_query("SET NAMES 'utf8' COLLATE 'utf8_unicode_ci';"); 
           
$this->conn $conn;
        }
        return(
$conn);
    }
    
    public function 
execute_sql($arg_sql,&$arg_result,&$arg_error_msg)
    {
        
$arg_sql str_replace(';'':'$arg_sql);
        
$this->getConnection();
        if (!(
$arg_result mysql_query($arg_sql)))
        {
            
$arg_error_msg "There was a problem With the Database".NL."Error : ".mysql_error().NL.NL;
            
$arg_error_msg .= "SQL = [".$arg_sql."]";
            echo 
$arg_sql1$arg_sql." ### ".mysql_error();
            return 
FALSE;
        }
        else 
        {
            return 
TRUE;
        } 
    }
}
?>
if comment out the private $conn line it just moves on and gives me exactly the same error on line 11.

any insight would much appreciated!
thanks
Reply With Quote

Featured Marketplace Scripts (view more)

  #2 (permalink)  
Old
Newbie Coder
 
Join Date: May 2009
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Problem Solved! I need PHP5
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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 On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRIN aprogrammer PHP 21 06-06-12 11:02 PM
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' Dr. Forensics PHP 3 07-15-06 03:54 PM
Parse error: parse error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' HELP stormshadow PHP 2 06-27-06 09:27 AM


All times are GMT -5. The time now is 10:07 AM.
vBulletin® Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.