Issue with data retrival from php
I have inserted some values in the database.
I am able to retrieve that using JAVA.
Output
===
2011-06-03 15:13:23.085 INFO net.spy.memcached.MemcachedConnection: Added {QA sa=localhost/127.0.0.1:11212, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, inte
2011-06-03 15:13:23.194 INFO net.spy.memcached.MemcachedConnection: Connection state changed for sun.nio.ch.SelectionKeyImpl@1a2961b
Cache get : sample1 : 0
Cache get : sample2 : 1
Cache get : sample3 : 2
Cache get : sample4 : 3
Cache get : sample5 : 4
Cache get : sample6 : 5
Time for 6 puts is 172 ms
2011-06-03 15:13:23.304 INFO net.spy.memcached.MemcachedClient: Shut down memcached client
==
Code I am using in Java:
String[] words = { "sample1","sample2","sample3","sample4","sample5","sample6"};
loop for i
String s = words[i];
Object o = cache.get(s);
System.out.println("Cache get : " + s + " : " + o);
=========
The same thing I am trying to retrive from php:
output is
====
NULL
Code I am using in PHP us :
$memcache->connect("127.0.0.1",11212 );
print_r($memcache->get("sample3"));
I am not sure what I am missing in php that it is not printing/retriving the data.
Can you please let me know.
2) Also I dont know why every 4 hours (or) saw I get a
Application ERROR window on my Machine.
It will ask do you want to send the report /CANCEL.
I will do CANCEL.
3) Also I see that the retival delay is very much more.
see the previous output from JAVA it is 172ms. looks it is more..
on the same computer I used to get a round 32ms.
I found the issue, not the solution :(
the php-get is not printing when the value is a integer.
if I populate value with a string it prints.
I think this has to do with some settings of the particular PHP library you're using.
Can you try with pecl-memcached and let us know if that's better?
If