Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | Membase | Membase Server 1.6.x

Issue with data retrival from php

3 replies [Last post]
  • Login or register to post comments
Fri, 06/03/2011 - 15:21
Adi
Offline
Joined: 05/26/2011
Groups: None

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.

Top
  • Login or register to post comments
Fri, 06/03/2011 - 16:27
Adi
Offline
Joined: 05/26/2011
Groups: None

If

Top
  • Login or register to post comments
Fri, 06/03/2011 - 19:04
Adi
Offline
Joined: 05/26/2011
Groups: None

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.

Top
  • Login or register to post comments
Sun, 06/05/2011 - 23:49
perry
Offline
Joined: 10/11/2010
Groups:

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?

__________________

Forum support is great for free but sometimes you need a guaranteed response time and dedicated resources for your questions or issues.
Consider purchasing enterprise-level support from Couchbase: http://www.couchbase.com/products-and-services/overview
Call or email "sales -at- couchbase-dot- com" today!

Top
  • Login or register to post comments
  • Login or register to post comments
  • Login
  • Register

Company

  • About Us
  • Leadership
  • Customers
  • Partners
  • Contact Us

Product

  • Couchbase Server
  • Couchbase SDKs
  • Use Cases
  • Documentation
  • Forums

Open Source

  • Couchbase Project
  • Couchbase vs. CouchDB

Commercial

  • Subscriptions & Support
  • Training & Services

News

  • Blog
  • Newsletter
  • Press Releases
  • Buzz

Follow Us

    
  • Customer Login
  • Terms of Service
  • Privacy Policy
  • Trademark Policy
  • Site Map

© 2013 COUCHBASE All rights reserved.

Sign in to Couchbase Community

close
  • Create new account
  • Request new password
You are logging into the Forums, Wiki and Issue Tracker