1

I use a php extension for Redis. There is a simple code:

$result = $this->redis->zUnion('mergedArr', array('FEED:User:459', 'FEED:User:458'));
var_dump($result); // It is returns 15 integer

$start = time();
$end = strtotime("+5 day");
$result = $this->redis->zRangeByScore('mergedArr', $start, $end, array('limit' => array(1, 1), 'withscores' => TRUE));


echo '<pre>';
   var_dump($result);
echo '</pre>';

At first line I merge two KEYS to a new array(KEY) mergedArr. Then in line 4 I tried to get limited and sorted data from mergedArr by score from 7 last days.

Why I get empty $result?

Documentation phpredis

AllenDegrud
  • 189
  • 2
  • 13
  • 1
    Use MONITOR to understand what is exactly sent to Redis. Probably one of the parameters, or perhaps the value of the score, is not what you think it is. – Didier Spezia Nov 03 '14 at 08:30

0 Answers0