0

I have configured the phpredis. When I set only 10 values in a list called tutorial list and call for the range 0, 9, I get all the values correct. But when I try range 0, 100 or 0, 267, I still get like 29 or 39 values.

Why am i seeing the repeated values when there are only 10 values?

My code:

$redis->lpush("tutorial-list", "Redis"); $redis->lpush("tutorial-list", "MongoDB");
    $redis->lpush("tutorial-list", "DynamoDB"); $redis->lpush("tutorial-list", "MS-SQL");
    $redis->lpush("tutorial-list", "MySQL"); $redis->lpush("tutorial-list", "NoSQL");
    $redis->lpush("tutorial-list", "Oracle"); $redis->lpush("tutorial-list", "Sybase");
    $redis->lpush("tutorial-list", "Sybase"); $redis->lpush("tutorial-list", "IBM DB2");

    $myList = $redis->lrange("tutorial-list",0,9);

    echo "<hr>Stored strings in Redis:: <pre>" ;
    print_r($myList);
Community
  • 1
  • 1
Somename
  • 3,376
  • 16
  • 42
  • 84
  • 1
    ideally it shouldn't happen. Can you try to see the whole list content ```lrange 0 -1``` in redis-cli if you have access ? – jssridhar Jan 31 '17 at 10:27
  • `lrange 0 -1` gives the proper values. But I am confused why its repeating the list. – Somename Feb 05 '17 at 08:54
  • if that is the case there is no problem in the setting values phase or at redis. you might want to look at how you are printing them. To help you better might need to see more code how you are actually using this. – jssridhar Feb 06 '17 at 16:01

0 Answers0