It seems to me that I am missing something really obvious, but I'm trying to use MySQL 5.6 and return values via memcache
So, I configured MYSQL to use the memcache plugin, configured the details in the innodb_memcache.containers table
Now I have two elements in this table: by default they are entered by MySQL and my own settings, both of them have table names.
To get data through php, I use:
$memcache->get($key);
Where $ key is the data in the db column
However, this does not return anything, I suspect that the reason is that according to the MySQL docs, if the table name is not specified, it selects the first in the list, which is not the one I want, that I don’t understand how I specify the correct name tables in the key, so he knows which table to look for the key in.
Additional Information:
table design: table: codes id INT PK code VARCHAR UNIQUE codeval VARCHAR innodb_memcache.containers : name: mycode db_schema: databaseName db_table: codes key_columns: code value_columns: codeval flags: id cas_column: null expire_time_column: null unique_idx_name_on_key: code
code:
$table = "mycode"; $key = "123456"; $memcache = new Memcache; $memcache->connect($this->CONNECTURL, $this->CONNECTPORT) or die ("Could not connect"); $version = $memcache->getVersion(); echo "Server version: ".$version."<br/>\n"; $key = "@@" . $table . "." . $key . "." . $table; $get_result = $memcache->get($key); print_r($get_result);
The above code returns the server version without any problems, so the connection works. print_r ($ get_result) returns a null value when it should return a value
It throws a notification: attempt to get a non-object property
So, if someone can tell me how I specify the $ key, which table I use for querying through memcache, I would be very grateful!