Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function read( $id ) {
- // Set empty result
- $data = '';
- // Fetch session data from the selected database
- $time = time();
- $newid = $this->mdb2->escape($id);
- $sql = "SELECT data FROM cake_sessions WHERE id = '$newid' AND expires > $time";
- $res =& $this->mdb2->query($sql);
- if (PEAR::isError($res)) {
- die($this->mdb2->getMessage());
- }
- if($res->numRows() > 0) {
- $row = $res->fetchRow();
- $data = $row['data'];
- }
- return $data;
- }
Add Comment
Please, Sign In to add comment