• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP where函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中where函数的典型用法代码示例。如果您正苦于以下问题:PHP where函数的具体用法?PHP where怎么用?PHP where使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了where函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: get_selected_record2

 public function get_selected_record2($customer_id, $method)
 {
     $this->_db->where('customer_id', $customer_id);
     $this->_db_ > where('payment_method', ".{$method}.");
     $data = $this->_db->get(TBL_SUBSCRIPTION);
     return $data;
 }
开发者ID:nikunj1806,项目名称:product-manager,代码行数:7,代码来源:subsription.class.php


示例2: index

 public function index()
 {
     $offer = where('slug = %s', 'nieuwbouw')->get_row('offer/purpose');
     echo view('head', array('title' => $offer && $offer->seo_title ? $offer->seo_title : 'Projecten', 'description' => $offer && $offer->seo_content ? $offer->seo_content : ''));
     echo view('projects', array());
     echo view('foot', array());
 }
开发者ID:kidaa30,项目名称:Swevers,代码行数:7,代码来源:projects.php


示例3: service

 public function service($slug)
 {
     $service = where('slug = %s', $slug)->require_row('services/service');
     echo view('head', array('title' => $service && $service->seo_title ? $service->seo_title : '', 'description' => $service && $service->seo_content ? $service->seo_content : ''));
     echo view('service', array('service' => $service));
     echo view('foot', array());
 }
开发者ID:kidaa30,项目名称:Swevers,代码行数:7,代码来源:services.php


示例4: beforeAction

 public function beforeAction($action)
 {
     $this->scanModules('payment');
     $arrModules = Modules::model()->findAllByAttributes(array('category' => 'payment'), array('order' => 'module'));
     $this->_allowAdvancedPayments = CPropertyValue::ensureBoolean(Yii::app()->params['ALLOW_ADVANCED_PAY_METHODS']);
     $menuSidebar = array();
     foreach ($arrModules as $module) {
         $currentModule = Yii::app()->getComponent($module->module);
         if (is_null($currentModule)) {
             continue;
         }
         if ($currentModule->cloudCompatible === false && _xls_get_conf('LIGHTSPEED_CLOUD') > 0) {
             continue;
         }
         if ($currentModule->isDisplayable() === false) {
             continue;
         }
         $menuSidebar[] = array('label' => $currentModule->AdminName, 'url' => array('payments/module', 'id' => $module->module), 'advancedPayment' => $currentModule->advancedMode);
     }
     $advancedPaymentMethods = where($menuSidebar, array('advancedPayment' => true));
     $simplePaymentMethods = where($menuSidebar, array('advancedPayment' => false));
     $this->menuItems = array_merge(array(array('label' => 'Simple Integration Modules', 'linkOptions' => array('class' => 'nav-header'))), $simplePaymentMethods, array(array('label' => 'Advanced Integration Modules', 'linkOptions' => array('class' => 'nav-header'), 'visible' => count($advancedPaymentMethods) > 0)), $advancedPaymentMethods, $this->getPaymentSetupLinks());
     $objModules = Modules::model()->findAllByAttributes(array('category' => 'payment', 'active' => 1));
     if (count($objModules) === 0 && $action->id == "index") {
         $this->noneActive = 1;
         Yii::app()->user->setFlash('error', Yii::t('admin', 'WARNING: You have no payment modules activated. No one can checkout.'));
     }
     return parent::beforeAction($action);
 }
开发者ID:uiDeveloper116,项目名称:webstore,代码行数:29,代码来源:PaymentsController.php


示例5: flat_load

/**
 * Load entity
 *
 * @param array $entity
 * @param array $crit
 * @param array $opts
 *
 * @return array
 */
function flat_load(array $entity, array $crit = [], array $opts = []) : array
{
    $stmt = db()->prepare(select($entity['attr']) . from($entity['tab']) . where($crit, $entity['attr'], $opts) . order($opts['order'] ?? [], $entity['attr']) . limit($opts['limit'] ?? 0, $opts['offset'] ?? 0));
    $stmt->execute();
    if (!empty($opts['one'])) {
        return $stmt->fetch() ?: [];
    }
    return $stmt->fetchAll();
}
开发者ID:akilli,项目名称:qnd,代码行数:18,代码来源:flat.php


示例6: searchProviders

 function searchProviders(Request $request)
 {
     $search = $request->input('search');
     $users = User::where('role_id', 2) > where(function ($query) use($search) {
         $query->Where('name', 'like', '%' . $search . '%')->orWhere('last_name', 'like', '%' . $search . '%')->orWhere('email', $search)->orWhere('second_name', 'like', '%' . $search . '%')->orWhere('second_last_name', 'like', '%' . $search . '%')->orWhere('identification', 'like', '%' . $search . '%');
     })->paginate(50);
     $roleName = $this->roleName;
     $routeSearch = 'searchProvider';
     return view('back.users', compact('users', 'roleName', 'routeSearch', 'search'));
 }
开发者ID:juan2ramos,项目名称:agroseller,代码行数:10,代码来源:ProviderController.php


示例7: index

 public function index()
 {
     $home = get_row('home');
     $sale = where('sold = 0 && purpose = 1')->limit(5)->order_by('create_date DESC')->get('skarabee/property');
     $rent = where('sold = 0 && purpose = 2')->limit(5)->order_by('create_date DESC')->get('skarabee/property');
     $projects = where('sold = 0 && type = 3')->limit(5)->order_by('create_date DESC')->get('skarabee/property');
     echo view('head', array('class' => 'home', 'css' => 'home', 'title' => $home->seo_title ? $home->seo_title : $home->title, 'description' => $home->seo_content ? $home->seo_content : $home->content));
     echo view('home', array('home' => $home, 'sale' => $sale, 'rent' => $rent, 'projects' => $projects));
     echo view('foot', array('js' => 'home'));
 }
开发者ID:kidaa30,项目名称:Swevers,代码行数:10,代码来源:home.php


示例8: tiempo_vida

 function tiempo_vida($nombre)
 {
     $this->db->select('tiempo_vida');
     $this->db - where('nombre', $nombre);
     $tiempo = $this->db->get('producto');
     if ($tiempo->num_rows() > 0) {
         return $tiempo->result();
     } else {
         return false;
     }
 }
开发者ID:editoblez,项目名称:labChemical,代码行数:11,代码来源:productos_model.php


示例9: leftframe

 public function leftframe()
 {
     //左边的默认首页
     $table = D('apptree');
     $pid = $_GET['apptreeid'];
     $leftdate = $table->findAll("type='0' and pid ='{$pid}'");
     foreach ($leftdate as $k => $v) {
         $leftdate[$k]['subapp'] = where(' pid =' . $v[id])->field('*')->order('seqNO ASC')->findall();
     }
     $this->assign('left', $leftdate);
     //dump($leftdate);
     $this->display();
 }
开发者ID:lee99,项目名称:tpmaker,代码行数:13,代码来源:IndexAction.class.php


示例10: excluirFuncionario

 public function excluirFuncionario($id_funcionario)
 {
     $result = false;
     if (!isset($_SESSION)) {
         session_start();
     }
     if (!isset($_SESSION['restaurante'])) {
         return $result;
     }
     if (!empty($id_funcionario)) {
         $this->_db > where("id_restaurante", $_SESSION['restaurante']);
         $this->_db > where("id_funcionario", $id_funcionario);
         return $this->_db->delete("functionario");
     }
     return $result;
 }
开发者ID:AvnerGeraldo,项目名称:TCC-SIRP,代码行数:16,代码来源:Funcionario_model.php


示例11: get_site_id

 private static function get_site_id()
 {
     $site = current_site();
     if ($site->piwik_id) {
         return $site->piwik_id;
     }
     $request = 'http://' . self::$api_urls[$_SERVER['SERVER_ADDR']] . '/?module=API&method=SitesManager.getSitesIdFromSiteUrl&url=http://' . rawurlencode($_SERVER['HTTP_HOST']) . '/&format=XML&token_auth=' . self::$auth_token;
     $result = simplexml_load_string(curl($request));
     if (isset($result->row->idsite)) {
         $site_id = $result->row->idsite;
     } else {
         $site_id = self::create_site();
     }
     where('id = %d', $site->id)->update('site', array('piwik_id' => $site_id));
     return $site_id;
 }
开发者ID:kidaa30,项目名称:Swevers,代码行数:16,代码来源:piwik.php


示例12: bind

 /**
  * Bind params, alias where()
  * in query use :param after binding.
  * @param  array $data array('param'=>'value')
  * @return none       
  */
 public function bind($data)
 {
     foreach ($data as $key => $value) {
         where($key, $value);
     }
 }
开发者ID:TheHanif,项目名称:POS-Faizan,代码行数:12,代码来源:class.database.php


示例13: function_delete

 public function function_delete($field, $object, $data, $id)
 {
     $fieldname = strval($field['name']);
     $field_filename = strval($field['name']) . '_filename';
     if (is_object($data)) {
         if ($data->{$fieldname}) {
             $data->{$fieldname}->clear_thumbnails();
         }
         @unlink(FILESPATH . $data->{$field_filename});
         where('id = %d', $data->id)->update($object['stack'], array($fieldname . '_filename' => '', $fieldname . '_orig_filename' => '', $fieldname . '_upload_date' => ''));
         redirect($_SERVER['HTTP_REFERER']);
     } else {
         error(404);
     }
 }
开发者ID:kidaa30,项目名称:Swevers,代码行数:15,代码来源:image.php


示例14: where_check

/** Create SQL condition from query string
* @param string
* @param array
* @return string
*/
function where_check($val, $fields = array())
{
    parse_str($val, $check);
    remove_slashes(array(&$check));
    return where($check, $fields);
}
开发者ID:K0n24d,项目名称:adminer,代码行数:11,代码来源:functions.inc.php


示例15: array

        if ($f['size']) {
            $toinsert = array();
            $extension = substr($f['name'], strrpos($f['name'], '.') + 1);
            do {
                $name = md5(rand(0, 99999) . rand(0, 99999));
            } while (file_exists(FILESPATH . $name . "." . $extension));
            move_uploaded_file($f['tmp_name'], FILESPATH . $name . "." . $extension);
            $toinsert['orig_filename'] = $f['name'];
            $toinsert['filename'] = $name . '.' . $extension;
            $toinsert['upload_date'] = time();
            $toinsert["site_id"] = intval($site->id);
            insert('site>downloads', $toinsert);
        }
    }
}
$site = where('id = %d', $site->id)->get_row('site');
?>
<!doctype html>
<!--[if lt IE 7 ]> <html class="no-js ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]>    <html class="no-js ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]>    <html class="no-js ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	
	<title><?php 
echo l(array('nl' => 'Downloads', 'en' => 'Downloads', 'fr' => 'Downloads'));
?>
</title>
	
开发者ID:kidaa30,项目名称:Swevers,代码行数:30,代码来源:downloadspopup.php


示例16: _get_parent_with_id

 public function _get_parent_with_id($id)
 {
     if ($this->_parents) {
         return $this->_parents->row_with_id($id);
     }
     if (count($this->_parent_ids) && $this->_parent_stack) {
         $this->_parents = where('id IN %$', $this->_parent_ids)->get($this->_parent_stack);
         return $this->_parents->row_with_id($id);
     }
     return NULL;
 }
开发者ID:kidaa30,项目名称:Swevers,代码行数:11,代码来源:resultset.php


示例17: function_comments

 public function function_comments($field, $object, $data, $id)
 {
     if ($row = where('id = %d', intval($id))->get_row($object['stack'] . '/' . $field['name'])) {
         $commentsfield = reset($field->xpath('object'));
         if (!$commentsfield) {
             error(404);
         }
         $commentsfield['stack'] = $object['stack'] . '/' . $field['name'] . '/' . $commentsfield['name'];
         $commentsquery = where($field['name'] . '_id', intval($id));
         $commentsamount = $commentsquery->count_rows($commentsfield['stack']);
         $commentsdata = $commentsquery->get($commentsfield['stack']);
         $segments = array_slice(func_get_args(), 4);
         if (count($segments)) {
             if (!FW4_Admin::handle_item($segments, $data)) {
                 error(404);
             }
         } else {
             echo view("head", array("pages" => FW4_Admin::get_pages(), "title" => isset($commentsfield['title']) ? $commentsfield['title'] : 'Comments', "user" => FW4_User::get_user(), "site" => current_site()));
             echo '<h2>' . (isset($commentsfield['title']) ? $commentsfield['title'] : 'Comments') . '</h2>';
             echo '<div class="input"><fieldset>';
             echo '<img src="' . $row->scale(100, 100) . '" class="thumbnail" style="display:inline-block;vertical-align:middle;margin-right:10px;"/><div style="display:inline-block;vertical-align:middle;">' . $row['orig_filename'] . '</div>';
             echo '</fieldset></div>';
             unset($commentsfield['title']);
             FW4_Admin::print_object_list($commentsfield, $commentsdata, $commentsamount, intval($id));
             echo '<div class="controls">';
             echo '<a class="button save" href="' . preg_replace('/[^\\/]+\\/[^\\/]+\\/[^\\/]+\\/?$/', '', $_SERVER['REQUEST_URI']) . '">' . l(array('nl' => 'Terug', 'fr' => 'Retour', 'en' => 'Back')) . '</a>';
             echo '</div>';
             echo view("foot", array('scripts' => array()));
         }
     } else {
         error(404);
     }
 }
开发者ID:kidaa30,项目名称:Swevers,代码行数:33,代码来源:images.php


示例18: get_setting_by_id

 function get_setting_by_id($id)
 {
     // return the setting
     $this->db - where('id', $id);
     $this->db->limit(1);
     $query = $this->db->get('setting');
     if ($query->num_rows() > 0) {
         return $query->row();
     }
     // no result
     return FALSE;
 }
开发者ID:jimok82,项目名称:CIOpenReview,代码行数:12,代码来源:Setting_model.php


示例19: editFunctions

 /** Functions displayed in edit form
  * @param array single field from fields()
  * @return array
  */
 function editFunctions($field)
 {
     global $edit_functions;
     $return = $field["null"] ? "NULL/" : "";
     foreach ($edit_functions as $key => $functions) {
         if (!$key || !isset($_GET["call"]) && (isset($_GET["select"]) || where($_GET))) {
             // relative functions
             foreach ($functions as $pattern => $val) {
                 if (!$pattern || preg_match("~{$pattern}~", $field["type"])) {
                     $return .= "/{$val}";
                 }
             }
             if ($key && !preg_match('~set|blob|bytea|raw|file~', $field["type"])) {
                 $return .= "/SQL";
             }
         }
     }
     if ($field["auto_increment"] && !isset($_GET["select"]) && !where($_GET)) {
         $return = lang('Auto Increment');
     }
     return explode("/", $return);
 }
开发者ID:kamrandotpk,项目名称:adminer,代码行数:26,代码来源:adminer.inc.php


示例20: handle_domain

 public function handle_domain($domain, $fields)
 {
     $domainname = preg_replace('/^www\\./is', '', $domain);
     if ($domain != 'www.' . $domainname && substr_count($domain, '.') < 2) {
         header('Location: http://www.' . $domainname . $_SERVER['REQUEST_URI']);
     }
     foreach ($fields as $field) {
         $stack = substr(strval($field['stack']), 0, strrpos(strval($field['stack']), '>'));
         $row = where(strval($field['name']) . ' = %s', $domainname)->get_row($stack);
         if ($row) {
             Router::set_content_prefix(strval($field['handler']));
             self::$current_domain = $row;
             return true;
         }
     }
     return false;
 }
开发者ID:kidaa30,项目名称:Swevers,代码行数:17,代码来源:domain.php



注:本文中的where函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP whereAdd函数代码示例发布时间:2022-05-23
下一篇:
PHP when函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap