I am trying to make a function that queries an array, and then I will be able to call the separate values. Here, I think you will understand what I am trying to do. Except I am a complete beginner to this.
class Posts{
var $title;
var $author;
public function querySinglePost($value){
$post = mysql_fetch_array(mysql_query("select * from posts where id=$value"));
$this->title = $post['title'];
$this->author = $post['author'];
}
}
How can I assign the array values to variables in the class, and then call them in my normal php script/view? Thanks