ดีจ้า ช่วยหน่อยน่ะท่านเทพทุกคนเลย ใครพอทราบเกี่ยวกับ error ตัวนี้บ้าง
Parse error: parse error, unexpected T_VARIABLE, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}'
ตาม code นี้เลยน่ะ
<?
class ResultSet {
private $result;
public function __construct($result) {
$this->result = $result;
}
public function next() {
return mysql_fetch_array($this->result);
}
public function size() {
return mysql_num_rows($this->result);
}
}
class MySQL {
// Attribute
private $connect;
// Method
public function __construct() {
$this->connect = mysql_connect("localhost", "root", "123456") or die(mysql_error());
//$this->connect = mysql_connect("localhost", "admin_keang", "25522552") or die(mysql_error());
mysql_query("SET CHARACTER SET utf8");
mysql_select_db("xxxx", $this->connect);
}
public function query($sql) {
$ret = mysql_query($sql);
if (!$ret) {
die(mysql_error());
}
return new ResultSet($ret);
}
public function getLastInsertId() {
return mysql_insert_id();
}
public function __destruct() {
if ($this->connect) {
mysql_close($this->connect);
}
}
}
?>