您的位置:首页 > 数据库 > Redis

php-redis客户端使用方法

2011-09-21 16:41 549 查看
首先配置好环境,这里就不多说了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 );


来源地址
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: