We will create the
StatusPoster.php file and the class skeleton using the NetBeans code template, and to create methods within the class, we will use the
function template as well. We will create a MySQL database connection using a PDO inside the class constructor, so that the database connection is created along with the object instantiation and
getStatusPosts() method to fetch the status posts from the table.
chapter3, select New | PHP File..., and name the file
StatusPoster, as shown in the following screenshot: