Results 1 to 2 of 2

Thread: Parse error: syntax error, unexpected '=', expecting '&' or T_VARIABLE

  1. #1
    Join Date
    Dec 2007
    Posts
    123
    Thanks
    17
    Thanked 1 Time in 1 Post

    Question Parse error: syntax error, unexpected '=', expecting '&' or T_VARIABLE

    Why am I getting this error:

    Parse error: syntax error, unexpected '=', expecting '&' or T_VARIABLE in /home/abc/public_html/class.php on line 9


    Code:
    <?php
    
    class dbconnect{#Begin class
    
    	var $link;
    	
    	
    	function dbconnect($host='localhost',$user='myyser',$pass='mypas',$database='mydb'){
    	$this->link = mysql_connect($host,$user,$pass);
    	mysql_select_db($database,$this->link);
    	}#Connection function ends
    
    	function dbselect($qry){#Select function starts
    	$myqry = mysql_query($qry,$this->link);
    	$arr[] = mysql_fetch_assoc($myqry);
    	return $arr;
    	}#Select function ends
    
    }#End class
    
    
    
    ?>

  2. #2
    Join Date
    Apr 2008
    Posts
    2
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    Hi

    I tried this , it says no error... is it class.php?

    Cheers!!!!
    Dhansekar.G
    http://www.php-web-developer.net/

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •