本文整理汇总了PHP中aql::query方法的典型用法代码示例。如果您正苦于以下问题:PHP aql::query方法的具体用法?PHP aql::query怎么用?PHP aql::query使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类aql
的用法示例。
在下文中一共展示了aql::query方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: name
function name()
{
set_include_path(get_include_path() . PATH_SEPARATOR . BASEPATH . 'libraries/inc');
$aql = new aql();
$aql->set('basedir', '/etc/asterisk/');
$db = $aql->query("insert into t9.conf set callerid=\"'99' <99>\",section='555'");
echo $aql->errstr;
print_r($db);
return 'name';
}
示例2: aql
<?php
/*
* This is Test demo script for AQL
*/
error_reporting(E_ALL);
require "../inc/aql.php";
$a = new aql();
$setok = $a->set('basedir', './');
if (!$setok) {
echo __LINE__ . ' ' . $a->get_error();
}
$result = $a->query("insert into t15.conf set callerid=\"\\\"99\\\" <99>\",section='" . time() . "'");
if ($result == false) {
echo $a->get_error();
} else {
echo 'affected_rows :' . $a->get_affected_rows() . "\n";
}
示例3: aql
*/
error_reporting(E_ALL);
require "../inc/aql.php";
$a = new aql();
$setok = $a->set('basedir', './');
if (!$setok) {
echo __LINE__ . ' ' . $a->get_error();
}
// very simple test query
$query = <<<EOF
select * from t2.conf where section = 9999
EOF;
// select * from t2.conf where section != 'general' and section != NULL
// select section,host,secret FROM t2.conf where section <= 9995 and section != 'general' and section != null limit 6,1
// select section,host,secret FROM t2.conf where section like '%99%' and section != 'general' and section != null limit 1
$result = $a->query($query);
if ($result == false) {
echo $a->get_error();
} else {
print_r($result);
}
echo "====================================================================================\n";
# very simple test query
$query = "select * from t2.conf where section != 'general' and section != NULL limit 1";
$result = $a->query($query);
if ($result == false) {
echo $a->get_error();
} else {
print_r($result);
}
echo "====================================================================================\n";
示例4: aql
<?php
/*
* This is Test demo script for AQL
*/
error_reporting(E_ALL);
require "../inc/aql.php";
$a = new aql();
$setok = $a->set('basedir', './');
if (!$setok) {
echo __LINE__ . ' ' . $a->get_error();
}
$result = $a->query("insert into t10.conf set type='friend',section='8001',call-limit=1");
$result = $a->query("delete from t10.conf where section = '8001'");
if ($result == false) {
echo $a->get_error();
} else {
echo 'affected_rows :' . $a->get_affected_rows() . "\n";
}
示例5: elseif
echo "freedb free cached config file\n";
echo "select query select command.\n";
echo "alter query alter command.\n";
echo "update query update command.\n";
echo "insert query insert command.\n";
echo "use set basedir to load config.\n";
echo "delete query delete command.\n\n";
echo "for more help see http://www.freeiris.org/astconfquerylanguage\n\n";
} elseif ($input == 'quit') {
exit;
} elseif ($input == 'freedb') {
$aql->free_database();
echo "database freed.\n";
} elseif (preg_match('/^(select|alter|update|insert|delete|use) /i',$input)) {
$b1 = microtime(true);
$result = $aql->query($input);
$b2 = microtime(true);
if (!$result) {
echo $aql->get_error()."\n";
} else {
if (is_array($result)==true) {
echo "+-----------------+-------------------------------\n";
echo "+ SECTION +\n";
foreach ($result as $section => $dataref) {
echo "+-----------------+-------------------------------\n";
echo "+ $section";
if (strlen($section) <= 14) {
echo str_repeat(' ',(18-3-strlen($section)));
} else {
" ";
}
示例6: aql
<?php
/*
* This is Test demo script for AQL
*/
error_reporting(E_ALL);
require "../inc/aql.php";
$a = new aql();
$setok = $a->set('basedir', './');
if (!$setok) {
echo __LINE__ . ' ' . $a->get_error();
}
$result = $a->query("alter table t8.conf add nat='yes' after('allow[1]') where section = 'general'");
if ($result == false) {
echo $a->get_error();
} else {
echo 'affected_rows :' . $a->get_affected_rows() . "\n";
}
示例7: aql
<?php
/*
* This is Test demo script for AQL
*/
error_reporting(E_ALL);
require "../inc/aql.php";
$a = new aql();
$setok = $a->set('basedir', './');
if (!$setok) {
echo __LINE__ . ' ' . $a->get_error();
}
$result = $a->query("alter table t11.conf drop abcdefg");
if ($result == false) {
echo $a->get_error();
} else {
echo 'affected_rows :' . $a->get_affected_rows() . "\n";
}
示例8: aql
<?php
/*
* This is Test demo script for AQL
*/
error_reporting(E_ALL);
require "../inc/aql.php";
$a = new aql();
$setok = $a->set('basedir', './');
if (!$setok) {
echo __LINE__ . ' ' . $a->get_error();
}
// set manual commit
$a->autocommit = false;
$a->query("update t5.conf set call-limit = 1 where section = 8888");
$a->query("update t5.conf set call-limit = 1 where section = 9999");
$result = $a->commit('t5.conf');
if ($result == false) {
echo $a->get_error();
} else {
echo 'affected_rows :' . $a->get_affected_rows() . "\n";
}
示例9: aql
<?php
/*
* This is Test demo script for AQL
*/
error_reporting(E_ALL);
require "../inc/aql.php";
$a = new aql();
$setok = $a->set('basedir', './');
if (!$setok) {
echo __LINE__ . ' ' . $a->get_error();
}
$result = $a->query("insert into t14.conf set callerid=\"'99' <99>\",section='555'");
if ($result == false) {
echo $a->get_error();
} else {
echo 'affected_rows :' . $a->get_affected_rows() . "\n";
}