On Aug 21, 9:59 pm, Jeremiah Jester <[email protected]> wrote:
> I'm facing a bit of the same problem but with php. Followed the
> php.netexample here but the getMulti example doesn't seem to work.
> Getting a fatal
> error: unspecifed method getMulti().
>
> http://us.php.net/manual/en/memcached.getmulti.php
>
> I've verified that memcache is properly compiled into php via phpinfo()
>
> thanks,
> JJ
>
>  <?php
> $m = new Memcached();
> $m->addServer('localhost', 11211);
>
> $data = array(
>     'foo' => 'foo-data',
>     'bar' => 'bar-data',
>     'baz' => 'baz-data',
>     'lol' => 'lol-data',
>     'kek' => 'kek-data',
> );
>
> $m->setMulti($data, 3600);
>
> $null = null;
> $keys = array_keys($data);
> $keys[] = 'zoo';
> $got = $m->getMulti($keys, $null, Memcached::GET_PRESERVE_ORDER);
>
> foreach ($got as $k => $v) {
>     echo "$k $v\n";}
>
> ?>
>

Memcache & Memcached are two different extensions. Memcached is
probably the preferred as it uses libmemcached.
Memcache doesn't make a distinction in the API over get or multi-get,
same function for both.
http://uk.php.net/manual/en/function.memcache-get.php

Jared



Reply via email to