I've just started using Predis for Redis migration and I'm having trouble getting the zadd function to work with an array.
This code works:
foreach ($userIndexArr as $row) {
$usernames[] = 0;
$usernames[] = $row['username'];
$result = $this->cache->zadd('@person', 0, $row['username']);
}
This doesn't:
foreach ($userIndexArr as $row) {
$usernames[] = 0;
$usernames[] = $row['username'];
}
try {
$result = $this->cache->zadd('@person', $usernames);
} catch (Exception $e) {
echo 'Caught exception: ', $e->getMessage(), "\n";
}
And no error is thrown. Any help is much appreciated!
-J