Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- | c205f217 | foo | <?php
- class Paste extends MySQLData {
- public function __construct() {
- parent :: __construct();
- /* mapping table */
- $this->table = 'paste';
- }
- public function add($data) {
- $id = substr(sha1(rand()),8);
- parent::add("'$id', 'foo', '$data', NOW()");
- }
- public function getLatest() {
- return $this->get('1 order by datepaste desc limit 10');
- }
- }
Add Comment
Please, Sign In to add comment