本文整理匯總了PHP中MySQL::QuerySingleRow方法的典型用法代碼示例。如果您正苦於以下問題:PHP MySQL::QuerySingleRow方法的具體用法?PHP MySQL::QuerySingleRow怎麽用?PHP MySQL::QuerySingleRow使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類MySQL
的用法示例。
在下文中一共展示了MySQL::QuerySingleRow方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getLayeredFilter
function getLayeredFilter()
{
$sql = "SELECT filters FROM ps_layered_filter WHERE name = 'VisionFilter'";
$db = new MySQL();
return $db->QuerySingleRow($sql);
}
示例2: getProductBasePrice
function getProductBasePrice($id_product)
{
$sql = "SELECT * FROM ps_product WHERE id_product = {$id_product}";
$db = new MySQL();
$result = $db->QuerySingleRow($sql);
if ($db->RowCount() > 0) {
return $result->price;
} else {
return -1;
}
}
示例3: getIDManufacturer
/**
* Metodo utilizzato per recuperare id del produttore a partire dal nome
*
* @param String $produttore Nome del produttore
* @return Int Id del produttore presente nel db
*/
function getIDManufacturer($produttore)
{
$sql = "SELECT id_manufacturer FROM ps_manufacturer WHERE name = '{$produttore}'";
$db = new MySQL();
$result = $db->QuerySingleRow($sql);
return $result->id_manufacturer;
}
示例4: getIdProductFromCode
function getIdProductFromCode($code)
{
if (isset($this->_MAPPING_PRODOTTI_CODE_ID[$code])) {
return $this->_MAPPING_PRODOTTI_CODE_ID[$code];
} else {
return null;
}
$db = new MySQL();
$sql = "SELECT id_product FROM ps_product WHERE code = '{$code}'";
$result = $db->QuerySingleRow($sql);
return $result->id_product;
}
示例5: getIdUserFromCode
function getIdUserFromCode($code)
{
$db = new MySQL();
$sql = "SELECT id_customer FROM ps_customer WHERE code = '{$code}'";
$result = $db->QuerySingleRow($sql);
return $result->id_customer;
}
示例6: getCategoryShopLastPosition
/**
* Metodo utilizzato per recuperare ultimo valore di position all'interno della tabella ps_category_shop
*
* @return int $position Ultimo valore di position presente
*/
function getCategoryShopLastPosition()
{
$db = new MySQL();
$sql = "SELECT position FROM ps_category_shop WHERE id_category > 2 ORDER BY position DESC";
$result = $db->QuerySingleRow($sql);
if ($db->RowCount() > 0) {
return $result->position + 1;
} else {
return 1;
}
}
示例7: getStateFromId
/**
* Metodo per recuperare la stringa ISO_CODE della provincia del customer Prestashop
*
* @param int $id_state Identificativo della provincia associata al customer
* @return ISO_CODE Sigla della provincia del customer PRestashop
*
*/
function getStateFromId($id_state)
{
$query = "SELECT * FROM ps_state WHERE id_state = {$id_state}";
$db = new MySQL();
$result = $db->QuerySingleRow($query);
return $result->iso_code;
}