本文整理汇总了PHP中SqlQuery::select方法的典型用法代码示例。如果您正苦于以下问题:PHP SqlQuery::select方法的具体用法?PHP SqlQuery::select怎么用?PHP SqlQuery::select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SqlQuery
的用法示例。
在下文中一共展示了SqlQuery::select方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct($db)
{
$this->db = $db;
$stmt = SqlQuery::select($db, 'site_globals');
$result = $stmt->get_result();
while ($row = $result->fetch_assoc()) {
$this[$row['site_global_name']] = $row['site_global_value'];
}
$stmt->close();
}
示例2: select
static function select($db, $table_name, $where = null, $bindings = null, $types = null, $paging = null, $orderby = null)
{
$list = [];
$stmt = SqlQuery::select($db, $table_name, $where, $bindings, $types, $paging, $orderby);
if ($stmt) {
$result = $stmt->get_result();
$class = get_called_class();
while ($row = $result->fetch_assoc()) {
$model = new $class($db);
$model->setData($row);
$list[] = $model;
}
$stmt->close();
}
return $list;
}
示例3: myTrim
$category->data['category_parent_id'] = $parent->ival('category_id');
}
$new++;
} else {
$updated++;
}
// update existing category
$category->data['category_name'] = myTrim(convertEncoding($row['cat_name']));
$category->save();
}
$stmt->close();
}
*/
$stmt = SqlQuery::select($cube_db, 'cubecart_inventory');
if ($stmt) {
$result = $stmt->get_result();
while ($row = $result->fetch_assoc()) {
$product = new Product($db);
$product->loadByExtId($row['productId']);
// import new product
if (!$product->is_loaded) {
$product->data['product_ext_id'] = $row['productId'];
$product->data['product_name'] = myTrim(convertEncoding($row['name']));
$product->data['product_price'] = parseFloat($row['price']);
$category = loadCategory($row['cat_id']);
if (isset($category)) {
$product->data['product_category_id'] = $category->ival('category_id');
}
$new++;