【问题标题】:Problems with using hmset in Predis在 Predis 中使用 hmset 的问题
【发布时间】:2013-06-18 16:37:13
【问题描述】:

我在使用$predis->hmset() 时遇到问题。我需要使用哪些参数? 我尝试了许多变体,但都没有成功。

$this->client()->hmset( $this->name, array( 1 => 3 ))

$this->client()->hmset( $this->name, array( 1, 3 ))

【问题讨论】:

标签: php redis predis


【解决方案1】:

来自the predis examples

// Prepare an hash with some fields and their respective values.
$client->hmset('metavars', array('foo' => 'bar', 'hoge' => 'piyo', 'lol' => 'wut'));

也许,请确保您使用的是字符串而不是整数...

【讨论】:

  • 错误是连接到redis。谢谢回答:)
猜你喜欢
  • 1970-01-01
  • 2017-12-04
  • 2018-04-29
  • 2017-12-23
  • 2015-12-18
  • 2011-09-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多