本文整理汇总了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;
}