Guest User

Untitled

a guest
Nov 20th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. | c205f217 | foo | <?php
  2. class Paste extends MySQLData {
  3. public function __construct() {
  4. parent :: __construct();
  5. /* mapping table */
  6. $this->table = 'paste';
  7. }
  8.  
  9. public function add($data) {
  10. $id = substr(sha1(rand()),8);
  11. parent::add("'$id', 'foo', '$data', NOW()");
  12. }
  13.  
  14. public function getLatest() {
  15. return $this->get('1 order by datepaste desc limit 10');
  16. }
  17. }
Add Comment
Please, Sign In to add comment