本文整理匯總了PHP中cls_mysql::getAll方法的典型用法代碼示例。如果您正苦於以下問題:PHP cls_mysql::getAll方法的具體用法?PHP cls_mysql::getAll怎麽用?PHP cls_mysql::getAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類cls_mysql
的用法示例。
在下文中一共展示了cls_mysql::getAll方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: addslashes
$html->clear();
unset($html);
}
exit;
*/
/*
$str = "<img src='http://www.benhu.com/images/upload/fckautosave/201409/1410747983-2.jpg' data-cls='fdsf'>" ;
$str = addslashes($str);
$sql = "UPDATE ecs_goods SET goods_desc = '$str' WHERE goods_id = 1"; // .$good['goods_id'];
$db->query($sql);
exit;
*/
$sql = "SELECT goods_id,goods_desc FROM ecs_goods WHERE goods_id >= 2676 ORDER BY goods_id ASC";
$goods = $db->getAll($sql);
foreach ($goods as $key => $good) {
$html = str_get_html($good['goods_desc']);
foreach ($html->find('img') as $element) {
$element->style = null;
$element->align = null;
$element->class = null;
}
// echo $element->src . '<br>';
//$str = $html->innertext ;
$str = $html;
$str = addslashes($str);
$sql = "UPDATE ecs_goods SET goods_desc = '{$str}' WHERE goods_id = " . $good['goods_id'];
$db->query($sql);
$html->clear();
unset($html);
示例2: empty
$_POST = empty($_POST) ? '' : input_filter($_POST);
$_COOKIE = empty($_COOKIE) ? '' : input_filter($_COOKIE);
$_FILES = empty($_FILES) ? '' : input_filter($_FILES);
}
//開始獲得客戶端的參數
$ip = ip();
$referer_url = referer_url();
$url = url();
//初始化數據庫
$db = new cls_mysql();
$db->connect($dbhost, $dbuser, $dbpw, $dbname, $charset, $pconnect);
unset($dbhost, $dbuser, $dbname, $charset, $pconnect);
//獲取網站配置信息
$config = array();
$sql = 'SELECT * FROM ' . table('config');
$res = $db->getAll($sql);
foreach ($res as $row) {
$config[$row['key']] = $row['value'];
}
$page_size = $config['page_size'];
unset($res);
//初始化模板
$smarty = new Smarty();
if (defined('IN_PBADMIN')) {
$smarty->template_dir = PBBLOG_ROOT . '/' . PBBLOG_WS_ADMIN . '/templates';
$smarty->compile_dir = PBBLOG_ROOT . '/home/admin_compiled';
$smarty->caching = false;
} elseif (!defined('IN_PBADMIN')) {
$smarty->template_dir = PBBLOG_ROOT . '/themes/' . $config['template_name'];
$smarty->compile_dir = PBBLOG_ROOT . '/home/compiled';
//開啟緩存