View unanswered posts | View active topics It is currently Sat Dec 16, 2017 2:33 am



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?

<?php
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] ."')"
$this->result=$this->mysqli->query($this->sql);
if($result==1){ ?>
<script language="JavaScript">
alert("Message was successfully saved!!!");
</script>

<?php
}

}
?>


tnx
Anton


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

Who is online

Users browsing this forum: No registered users and 2 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:  
cron
© Copyright 2003-2008 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.