<?php
class article{
private $row;
public function __construct(){
require_once('connection.php');
mysql_select_db($db, $test);
$query = "SELECT * FROM articles WHERE path = $_SESSION['path']";
$result = mysql_query($query, $test) or die(mysql_error());
$this->row = mysql_fetch_array($result);
}
public function process($field) {
if($field == 'tool'){
echo $this->row['path'];
}
else if($field == 'test'){
echo $this->row['title'];
}
}
}
$obj = new article();
$obj->process('tool');
$obj = new article();
$obj1->process('test');
?>
How to run the process method twice in this scenario? It just run once and execution stops.