You need some magic :) Read about quotes in php
host="localhost";
$this->user="cgiadmin";
$this->pass="cgi";
$this->data="j2";
}
public function connection()
{
$this->con = mysql_connect($this->host,$this->user,$this->pass);
}
public function tablename()
{
$this->table=mysql_query("INSERT INTO employee(name,number) VALUES ('".$_POST[name]."','".$_POST[number]."')");
}
public function databaseconnection()
{
$this->db=mysql_select_db($this->data,$this->con);
}
}
$name=new Database();
$name->controls();
$name->connection();
if(!($name->con))
{
echo 'Error: ' . mysql_error();
}
$name->databaseconnection();
$name->tablename();
echo "thanks for taking the survey";
?>