Thanks.
Code: Select all
class NewProject{
protected $pid;
protected $query;
protected $errorMsg="";
public function __construct(){
$this->pid=$_GET['id'];
}
public function projectQuery(){
$this->query="SELECT project_id, project_name, project_des
FROM project
WHERE project_id='$this->pid'";
return $this->query;
}
public function queryResults(){
$result=mysql_query($this->query) or die (mysql_error());
if($result){
$row=mysql_fetch_assoc($result);
}else{
$this->errorMsg="Sorry, this project does not exist";
}
return $row;
}
}