Oracle 5.0 Reference Manual page 2723

Table of Contents

Advertisement

condition_option
Examples
Example 20.326.
<?php
/* Cache all accesses to tables with the name "new%" in schema/database "db_example" for 1 second */
if (!mysqlnd_qc_set_cache_condition(MYSQLND_QC_CONDITION_META_SCHEMA_PATTERN, "db_example.new%", 1)) {
die("Failed to set cache condition!");
}
$mysqli = new mysqli("host", "user", "password", "db_example", "port");
/* cached although no SQL hint given
$mysqli->query("SELECT id, title FROM news");
$pdo_mysql = new PDO("mysql:host=host;dbname=db_example;port=port", "user", "password");
/* not cached: no SQL hint, no pattern match */
$pdo_mysql->query("SELECT id, title FROM latest_news");
/* cached: TTL 1 second, pattern match */
$pdo_mysql->query("SELECT id, title FROM news");
?>
Return Values
Returns TRUE on success or FALSE on FAILURE.
See Also
Quickstart: pattern based caching
20.7.7.7.8.
mysqlnd_qc_set_is_select
Copyright 1997-2012 the PHP Documentation Group. [2230]
mysqlnd_qc_set_is_select
Installs a callback which decides whether a statement is cached
Description
mixed mysqlnd_qc_set_is_select(
string callback);
Installs a callback which decides whether a statement is cached.
There are several ways of hinting PELC/mysqlnd_qc to cache a query. By default, PECL/mysqlnd_qc
attempts to cache a if caching of all statements is enabled or the query string begins with a certain
SQL hint. The plugin internally calls a function named
can be replaced with a user-defined callback. Then, the user-defined callback is responsible to decide
whether the plugin attempts to cache a statement. Because the internal function is replaced with
the callback, the callback gains full control. The callback is free to ignore the configuration setting
mysqlnd_qc.cache_by_default
The callback is invoked for every statement inspected by the plugin. It is given the statements string
as a parameter. The callback returns
Mysqlnd query result cache plugin (mysqlnd_qc)
match one or many arbitrary characters.
character. The escape symbol is backslash.
Option for condition. Type and structure depend on
condition_type.
If
condition_type
MYSQLND_QC_CONDITION_META_SCHEMA_PATTERN
condition_options
mysqlnd_qc_set_cache_condition
*/
and SQL hints.
FALSE
equals
is the TTL to be used.
example
is_select()
if the statement shall not be cached. It returns
2703
will match one arbitrary
_
to find out. This internal function
TRUE
to

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents