weafer

weafer的技术博客

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

首先配置好环境,这里就不多说了redis服务端,以及redis的PHP扩展包;

View Code
<?php  
require 'redis.php';
require 'redis_pool.php';
require 'redis_peer.php';
class note extends redis_peer {}
$note = new note();
# Create note, primary key is generated automatically
$id = $note->insert( array('title' => 'Hello', 'body' => 'world!') );
# Update note
$id = $note->update( $id, array('body' => 'wwwwworld!') );
# Get some note by primary key
$note_data = $note->get_by_id( $id );
# Delete note $note->delete( $id );


来源地址

posted on 2011-09-21 16:41  weafer  阅读(2637)  评论(0编辑  收藏  举报