本文整理汇总了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';
//开启缓存