本文整理汇总了PHP中DbHelper::fetchAll方法的典型用法代码示例。如果您正苦于以下问题:PHP DbHelper::fetchAll方法的具体用法?PHP DbHelper::fetchAll怎么用?PHP DbHelper::fetchAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DbHelper
的用法示例。
在下文中一共展示了DbHelper::fetchAll方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getsubCategoryIds
public static function getsubCategoryIds($categoryId)
{
global $tableprefix;
if (!empty($categoryId)) {
$resSet = DbHelper::execute("SELECT category_id from " . $tableprefix . "categories cat where cat.route REGEXP '^" . $categoryId . ",|,^" . $categoryId . "|," . $categoryId . ",|," . $categoryId . "\$|^" . $categoryId . "\$' ");
$data = DbHelper::fetchAll($resSet);
if (count($data) > 0) {
foreach ($data as $data_value) {
$category_array[] = $data_value->category_id;
}
$categoryString = implode("','", $category_array);
}
}
return $categoryString;
}
示例2: productViewedReport
productViewedReport(GetSQLValueString($productid, "text"), $_SESSION["sess_userid"]);
$USER_ID = $_SESSION["sess_userid"];
}
/* Items Bought By */
$resIB = DbHelper::execute("SELECT od.product_id,od.product_name,op.image_small,op.image_big\n FROM " . $tableprefix . "order_details od\n INNER JOIN " . $tableprefix . "product_options op ON od.product_option_id = op.product_option_id\n INNER JOIN " . $tableprefix . "products p ON p.product_id \t = op. \tproduct_id\n WHERE od.order_id IN (SELECT GROUP_CONCAT(DISTINCT d.order_id ORDER BY d.order_id DESC SEPARATOR ', ') FROM " . $tableprefix . "order_details d WHERE d.product_id = '" . mysql_real_escape_string($_GET['productid']) . "')\n AND p.deleted = 'N' AND od.product_id != '" . $_GET['productid'] . "' AND od.item_status IN(1, 3, 4) GROUP BY od.product_id LIMIT 0,12");
/*$resIB = DbHelper::execute("SELECT DISTINCT od.product_id,od.product_name,op.image_small,op.image_big
FROM ".$tableprefix."order_details od
LEFT JOIN ".$tableprefix."product_options op
ON
od.product_option_id = op.product_option_id LIMIT 12");*/
$IBArr = DbHelper::fetchAll($resIB);
/* Other Intrested Items Bought By */
//$resOI = DbHelper::execute("SELECT p.product_id,p.product_name,op.image_small,op.image_big FROM ".$tableprefix."products p LEFT JOIN ".$tableprefix."product_options op ON p.product_id = op.product_id WHERE p.vIntrest='Y' AND p.product_id != '".$_GET['productid']."' GROUP BY p.product_id LIMIT 0,12");
$sql_interest = "SELECT p.product_id,p.product_name,op.image_small,op.image_big FROM " . $tableprefix . "products p\n LEFT JOIN " . $tableprefix . "product_options op ON p.product_id = op.product_id\n INNER JOIN " . $tableprefix . "categories c ON c.category_id = p.product_category\n WHERE p.vIntrest='Y' AND p.product_id != '" . mysql_real_escape_string($_GET['productid']) . "'\n AND p.deleted = 'N' AND c.vEnable='Y' GROUP BY p.product_id LIMIT 0,12";
$resOI = DbHelper::execute($sql_interest);
$OIArr = DbHelper::fetchAll($resOI);
/* display the active template */
$active_template = displayTemplate();
include "includes/htmltop.php";
/* Top File Name */
include_once "includes/" . $active_template[0];
$quantity = getWholesaleProductCount($prow["product_option_id"]);
// Check product is whole sale item or not
$eWholesaleItem = isWholesaleItem($productid);
//Check Selected Option Added to Wish List
$wishItemCount_Product = getWishItemsCount_Product($productid, $prow["product_option_id"]);
// Current Stock Available for a product
$currentStockAvailable = getCurrentStockAvailable($productid, $prow["product_option_id"]);
?>
<!--<script
type="text/javascript"
示例3: addslashes
</div>
<div class="clear"></div>
<?php
/* Product list carousel*/
/*$productListingFee = getSettingsValue('product_listing_fee');
$sql ="SELECT p.product_id,p.product_name,po.image_small,po.image_big FROM ".$tableprefix."products p
INNER JOIN ".$tableprefix."product_options po ON po.product_id = p.product_id AND po.default_option='YES'
INNER JOIN ".$tableprefix."artists s ON p.product_artist_id = s.artist_id
WHERE p.product_artist_id='".$artistid."' AND p.vapproved = 'Y' AND s.vapproved='Y'
AND s.plan_expired='N'";
if($productListingFee > 0) {
$sql .= " AND p.payment_status='COMPLETED' ";
}
$sql .= " AND p.deleted !='Y' LIMIT 0,100";
$resOV = DbHelper::execute($sql);
$OVArr = DbHelper::fetchAll($resOV);*/
$sql = "SELECT ap.* FROM " . $tableprefix . "artists a INNER JOIN " . $tableprefix . "mybusiness ap ON a.artist_id = ap.artistid WHERE ap.artistid = '" . addslashes($artistid) . "' LIMIT 0,100";
$resOV = DbHelper::execute($sql);
$OVArr = DbHelper::fetchAll($resOV);
if (count($OVArr) > 0) {
?>
<div class="txtblue">Click on thumbnail for a virtual tour of our business...</div>
<?php
include_once BASE_URL . '/product_details_page_carousel.php';
clsCreateCarousel::showVendorBusinessCurozileItems($OVArr);
}
?>
</div>
示例4: getVendorNamesByOrderId
public static function getVendorNamesByOrderId($orderId = 0)
{
global $tableprefix;
$query = "SELECT DISTINCT CONCAT(ar.first_name ,' ', ar.last_name) as name, ar.artist_id FROM " . $tableprefix . "order_details od\n\t\t\t\t\t\tINNER JOIN " . $tableprefix . "artists ar ON od.artist_id = ar.artist_id\n WHERE od.order_id = '" . mysql_real_escape_string($orderId) . "'";
$resCat = DbHelper::execute($query);
$data = DbHelper::fetchAll($resCat);
return $data;
}
示例5: listVendorFeedbacks
public static function listVendorFeedbacks($userid)
{
global $tableprefix;
$sql = " SELECT f.*, u.user_name, a.first_name,a.last_name ,u.email FROM " . $tableprefix . "artist_feedbacks f\n\t\tINNER JOIN " . $tableprefix . "users u ON f.user_id = u.user_id\n\t\tINNER JOIN " . $tableprefix . "artists a ON f.artist_id = a.artist_id\n WHERE f.user_id = " . $userid . "\n AND f.published = 'Y' AND f.deleted = 0\n \t ORDER BY date_added DESC ";
$result = DbHelper::execute($sql);
$vendor_feedbacks = DbHelper::fetchAll($result);
return $vendor_feedbacks;
}
示例6: elseif
}
}
echo $msg;
exit;
} elseif (isset($_POST['txtaction']) && $_POST['txtaction'] == 'checkproductvalid') {
if (isset($_REQUEST['chkproductid'])) {
$chkProductId = $_REQUEST['chkproductid'];
$controlstatus = $_REQUEST['controlstatus'];
$sqlCountInterest = "SELECT pd.vIntrest as cntInt FROM " . $tableprefix . "products pd\n INNER JOIN " . $tableprefix . "product_options po ON po.product_id = pd.product_id\n INNER JOIN " . $tableprefix . "artists ar ON ar.artist_id = pd.product_artist_id\n WHERE pd.vapproved='Y' AND ar.vapproved='Y' AND pd.deleted ='N' AND ar.vacationmode = 'N'\n AND ar.plan_expired='N' AND po.product_stock > 0 AND pd.product_id = '" . mysql_real_escape_string($chkProductId) . "'";
$intrestRes = DbHelper::execute($sqlCountInterest);
$intrestArr = DbHelper::fetchAll($intrestRes);
if (count($intrestArr) == 1) {
if ($controlstatus == "true") {
$sqlCountInterest = "SELECT COUNT(pd.vIntrest) as cntInt FROM " . $tableprefix . "products pd\n INNER JOIN " . $tableprefix . "product_options po ON po.product_id = pd.product_id\n INNER JOIN " . $tableprefix . "artists ar ON ar.artist_id = pd.product_artist_id\n WHERE vIntrest='Y' AND pd.vapproved='Y' AND ar.vapproved='Y' AND pd.deleted ='N' AND ar.vacationmode = 'N'\n AND ar.plan_expired='N' AND po.product_stock > 0 AND pd.product_id NOT IN ({$chkProductId})";
$intrestRes = DbHelper::execute($sqlCountInterest);
$intrestArr = DbHelper::fetchAll($intrestRes);
//print_r($intrestArr);
$intrestCount = $intrestArr[0]->cntInt;
if ($intrestCount < 12) {
// echo "UPDATE ".$tableprefix."products SET vIntrest='Y' WHERE product_id IN ($productStr)";
DbHelper::execute("UPDATE " . $tableprefix . "products SET vIntrest='Y' WHERE product_id = '" . mysql_real_escape_string($chkProductId) . "'");
echo 1;
exit;
/* foreach($prodArr as $itemProd){
DbHelper::execute("UPDATE ".$tableprefix."products SET vIntrest='Y' WHERE product_id=".$itemProd);
$msg =1;
}*/
} else {
echo 2;
exit;
}
示例7: IFNULL
$sellerProfileImageURL = $imageurl;
$sellerProfileImage = $portfoliodir . "noimage.jpg";
} else {
$imageurl = "<img src='" . $portfoliodir . $txtArtistPhoto . "' border='0' width='191' height='183' >";
$sellerProfileImageURL = $imageurl;
$sellerProfileImage = $portfoliodir . $txtArtistPhoto;
}
// Seller Rating
$sellerRes = DbHelper::execute("SELECT IFNULL(ROUND(AVG(rating),0),0) as rating FROM " . $tableprefix . "artist_feedbacks WHERE published = 'Y' AND artist_id =" . $artistid);
$sellerRatingArr = DbHelper::fetchAll($sellerRes);
// Total rating
$sellerRating = $sellerRatingArr[0]->rating;
// End Seller Rating
// User Info
$userInfoRes = DbHelper::execute("SELECT email,user_name FROM " . $tableprefix . "users WHERE user_id = '" . $_SESSION["sess_userid"] . "'");
$userInfoArr = DbHelper::fetchAll($userInfoRes);
$email_address = $userInfoArr[0]->email;
$contact_name = $userInfoArr[0]->user_name;
if (strstr($contact_name, 'Guest') != '') {
$contact_name = '';
}
// User Info
}
/*----------Multicart 2.0 Upgradation Starts------------*/
if ($enable_seller_friendly == "Y") {
$artist_name = $row['artist_name'];
}
/*----------Multicart 2.0 Upgradation Ends------------*/
/*display the active template*/
$active_template = displayTemplate();
//End pagination settings