Hi Folks,
I am writing my first Class (its about time too), and im a bit confused with the best way to do it. Here is what I have:
class news {
var $record;
var $id;
var $startdate;
var $title;
var $description;
function return_id(){
return $this->$id;
}
function return_startdate(){
return $this->$startdate;
}
function return_title(){
return $this->$title;
}
function return_description(){
return $this->$description;
}
function record(){
$this->record ++;
}
function reset(){
$this->record =0;
}
function getnews(){
$id[0] = "ID 1";
$id[1] = "ID 2";
$id[2] = "ID 3";
$des[0] = "description 1";
$des[1] = "description 2";
$des[2] = "description 3";
$titl[0] = "title 1";
$titl[1] = "title 2";
$titl[2] = "title 3";
}
function con() {
return mysql_connect("localhost", "root");
}
function sel() {
return mysql_select_db("ims");
}
}
Ok, so what I need to do is call a record at a time ( the get news function will be database records, I have just created an array for testing). I am having problems constructing this. Has any one any ideas how I could do this ? p.s. I may only need to call five records (individually).
cheers for any help.