View unanswered posts | View active topics It is currently Sun Oct 21, 2018 10:33 pm

Reply to topic  [ 1 post ] 
 parse error, expecting `T_FUNCTION' 
Author Message
Junior Member

Joined: Mon Feb 15, 2010 4:57 am
Posts: 1
Post parse error, expecting `T_FUNCTION'
I have tried to initiate mysqli within my own class but following error appeared,I'll paste the code below someone pls tell me whts wrong with my code and how do this?

class Incident{
var $sql;
var $host;
var $password;
var $db;
var $UserName;
var $data=array();
var $result;
var $mysqli;

$mysqli=new mysqli("localhost","root"," ","dmssddb");//parse error, expecting `T_FUNCTION' error is comming from this line.

//('". $this->host ."','".$this->UserName."','".$this->password."','".$this->db."');
echo $mysqli->error;

function save(){
$sql="INSERT INTO tabIncident VALUES('". $this->data[0] ."','". $this-> data[1]."','".$this->data[2] ."','".$this->data[3] ."','".$this->data[4] ."','".$this->data[5] ."','".$this->data[6] ."','".$this->data[7] ."','".$this->data[8] ."','".$this->data[9] ."')"
if($result==1){ ?>
<script language="JavaScript">
alert("Message was successfully saved!!!");




Mon Feb 15, 2010 5:19 am
Report this post
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 0 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
© Copyright 2003-2008 The ultimate PHP Editor and PHP IDE site.