Im very new to Redis, and after have seeing the redis FAQ i have a question regarding hmset.
It seems like hmset is the best way for me to store user rows from my mysql DB. So if i had an array returned from mysql like this:
array(
'userid' => 1,
'username' => 'test',
'password' => 'example2222',
'health' => 120
);
how could i easily insert this to the redis hmset or make an funciton that would take the result and make a hmset from the array?
etg:
user:1 username test password example2222 health 120
I was thinking something like.
If userid not exist in redis -> get the row from MYsqlDB and do redis hmset with the result.
I'm using Predis to store your array, code tested