大佬,Redis如何删除一个GEO地理位置数据??? 我从redis取了几十条数据,加个删除选项删除一条数据,怎么做? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <html><head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>测试工具</title></head><body><form action="" method="get"> Session: <input type="text" name="username"> <br> <input type="submit" value="登录" name="subl"> <div><?php if (isset($_GET['username'])) { header("Content-Type:text/html;charset=utf-8"); $username = $_GET['username']; $redis = new Redis(); $redis->connect('127.0.0.1', 6379); $redis->auth('redis@7yi'); $redis->select(4); $k = $redis->keys('session:' . "*"); if (in_array('session:' . $username, $k)) { echo '你已登录'; $redis->select(2); $redis->geoadd('OrderGeoTree', '121.48012429475784302', '31.23359327436177324', '0'); $redis->geoadd('OrderGeoTree', '0.00000268220901489', '0.00000126736058093', '1'); $redis->geoadd('OrderGeoTree', '117.20841675996780396', '39.11611222593375459', '110'); $redis->geoadd('OrderGeoTree', '128.47578432480124209', '23.48359327436177324', '11'); $redis->geoadd('OrderGeoTree', '29.48012446575784302', '19.23359327773244361', '5'); $it=NULL; $keyArr = $redis->zScan('OrderGeoTree', $it); print_r($keyArr); echo '<hr>';// echo "<tr><td>帮忙</td><td>解决</td></tr>"; for ($i=0; $i < 140; $i++) { $k = $redis->geopos('OrderGeoTree', $i); print_r($i); print_r($k); $v = $i; ?> <form action="" method="get"> <input type="submit" value="删除" name="delid"><!-- --><?php //zRem($v); ?> </form> <?php } } else { echo 'Seesion有误!'; } } else { echo '还未登录!'; } ?></form></body></html><?phpfunction zRem($v){if (isset($v)) { $redis = new Redis(); $redis->connect('127.0.0.1', 6379); $redis->auth('redis@7yi'); $redis->select(2); $redis->zRem('OrderGeoTree', $v);}} PHP 图片上传,压缩,保存到服务器问题? 真心求解:apache+php+mysql配置问题 已经连上mysql数据库了,为什么网页显示无法连接数据库 找个备案查询小程序 php 环境下多站点共用同一函数或include同一文件 怪事了!为什么我的Zend Optimizer装不好呢?求助! wamp中的php有什么用 关于$sql的插入语句 php网站问题:连接用户太多 有关图像翻转的问题 imagettftext()绝对路径也报错 THINKPHP求助删除原来短信验证码
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>测试工具</title>
</head>
<body>
<form action="" method="get">
Session:
<input type="text" name="username"> <br>
<input type="submit" value="登录" name="subl">
<div><?php
if (isset($_GET['username'])) {
header("Content-Type:text/html;charset=utf-8");
$username = $_GET['username'];
$redis = new Redis();
$redis->connect('127.0.0.1', 6379);
$redis->auth('redis@7yi'); $redis->select(4);
$k = $redis->keys('session:' . "*"); if (in_array('session:' . $username, $k)) {
echo '你已登录'; $redis->select(2);
$redis->geoadd('OrderGeoTree', '121.48012429475784302', '31.23359327436177324', '0');
$redis->geoadd('OrderGeoTree', '0.00000268220901489', '0.00000126736058093', '1');
$redis->geoadd('OrderGeoTree', '117.20841675996780396', '39.11611222593375459', '110');
$redis->geoadd('OrderGeoTree', '128.47578432480124209', '23.48359327436177324', '11');
$redis->geoadd('OrderGeoTree', '29.48012446575784302', '19.23359327773244361', '5');
$it=NULL;
$keyArr = $redis->zScan('OrderGeoTree', $it);
print_r($keyArr);
echo '<hr>';
// echo "<tr><td>帮忙</td><td>解决</td></tr>";
for ($i=0; $i < 140; $i++) {
$k = $redis->geopos('OrderGeoTree', $i);
print_r($i);
print_r($k); $v = $i;
?>
<form action="" method="get">
<input type="submit" value="删除" name="delid">
<!-- --><?php //zRem($v); ?>
</form>
<?php
}
} else {
echo 'Seesion有误!';
} } else {
echo '还未登录!';
} ?>
</form></body>
</html>
<?php
function zRem($v)
{
if (isset($v)) {
$redis = new Redis();
$redis->connect('127.0.0.1', 6379);
$redis->auth('redis@7yi'); $redis->select(2);
$redis->zRem('OrderGeoTree', $v);
}
}