當前位置: 首頁>>代碼示例>>PHP>>正文


PHP cls_mysql::getAll方法代碼示例

本文整理匯總了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);
開發者ID:norain2050,項目名稱:benhu,代碼行數:31,代碼來源:formatGoodsDescImg.php

示例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';
    //開啟緩存
開發者ID:az0ne,項目名稱:simple_zoomeye,代碼行數:31,代碼來源:core.php


注:本文中的cls_mysql::getAll方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。