Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private function ListComments(){
- //Fetching my data
- $comments = static::$DB->SelectData("comments", array("username", "message", "date", "last"));
- //Checking if there is something new added
- if($comments[count($comments)-1]["last"] < count($comments)) {
- //Printing all the fetched data
- print json_encode($comments);
- //Updating the "last" column which is used to check if there are new enteries
- static::$DB->UpdateData("comments", array("last" => count($comments)), array("last" => 0));
- } else {
- print json_encode(array("x"));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment