October 2009
Beginner
408 pages
7h 27m
English
You can now that store comments in the database; your next task is to write a method that retrieves them.
This method, called retrieveComments(), accepts one argument: the ID of the blog that you need to retrieve comments for ($blog_id).
This new method works similarly to your retrieveEntries() function, except that you store the entries as an array in a property of the Comments class itself, for use with other methods.
Begin by declaring a new $comments property in the class; you use this property to store the loaded comments in memory.
Next, you need to write a SQL query that pulls all the entries from the comments table that match the given blog ID. Be sure to retrieve every column from the ...
Read now
Unlock full access