Log in

View Full Version : Parse error: syntax error, unexpected '=', expecting '&' or T_VARIABLE



cancer10
04-26-2008, 01:20 AM
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



<?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



?>

gdhanasekar
04-26-2008, 11:22 AM
Hi

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

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