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

PHP execQuery函数代码示例

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

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



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

示例1: removeCustomMenuItem

/**
 * Mantis 1.2 only !!
 * remove existing entries from mantis menu
 *
 * @param string $name 'CodevTT'
 */
function removeCustomMenuItem($name)
{
    // get current mantis custom menu entries
    $query = "SELECT value FROM `mantis_config_table` WHERE config_id = 'main_menu_custom_options'";
    $result = execQuery($query);
    $serialized = 0 != mysql_num_rows($result) ? mysql_result($result, 0) : NULL;
    // add entry
    if (!is_null($serialized) && "" != $serialized) {
        $menuItems = unserialize($serialized);
        foreach ($menuItems as $key => $item) {
            if (in_array($name, $item)) {
                echo "remove key={$key}<br>";
                unset($menuItems[$key]);
            }
        }
        $newSerialized = serialize($menuItems);
        // update mantis menu
        if (NULL != $serialized) {
            $query = "UPDATE `mantis_config_table` SET value = '{$newSerialized}' " . "WHERE config_id = 'main_menu_custom_options'";
        } else {
            $query = "INSERT INTO `mantis_config_table` (`config_id`, `value`, `type`, `access_reqd`) " . "VALUES ('main_menu_custom_options', '{$newSerialized}', '3', '90');";
        }
        $result = execQuery($query);
    } else {
        // echo "no custom menu entries found<br>";
    }
}
开发者ID:siebrand,项目名称:codev,代码行数:33,代码来源:remove_from_mantis_menu.php


示例2: onAction

 function onAction()
 {
     global $application;
     $emails_keys = modApiFunc('Request', 'getValueByKey', 'emails');
     $emails_topics = modApiFunc('Request', 'getValueByKey', 'topic');
     $customer_id = modApiFunc('Request', 'getValueByKey', 'customer_id');
     if (!is_array($emails_topics)) {
         $emails_topics = array();
     }
     foreach (array_keys($emails_keys) as $email) {
         $topics = @$emails_topics[$email];
         if (!is_array($topics)) {
             $topics = array();
         }
         modApiFunc('Subscriptions', 'changeSubscriptions', $email, $topics);
         $params = array('customer_id' => $customer_id, 'email' => $email);
         execQuery('SUBSCR_LINK_SUBSCRIPTION_TO_CUSTOMER', $params);
     }
     $messages['MESSAGES'][] = getMsg('SYS', 'SUBSCRIPTIONS_UPDATED');
     modApiFunc('Session', 'set', 'AplicationSettingsMessages', $messages);
     $request = new Request();
     $request->setView(CURRENT_REQUEST_URL);
     $request->setKey('page_view', modApiFunc('Request', 'getValueByKey', 'page_view'));
     $request->setKey('customer_id', $customer_id);
     $application->redirect($request);
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:26,代码来源:update_customer_subscriptions.php


示例3: validaDados

function validaDados()
{
    global $erro;
    global $acao;
    global $sistema;
    global $diretorioarquivos;
    global $urlarquivos;
    if (empty($sistema)) {
        $erro = "SISTEMA não informado.";
        return false;
    } else {
        if (empty($diretorioarquivos)) {
            $erro = "Diretorio de Arquivos não informado.";
            return false;
        } else {
            if (empty($urlarquivos)) {
                $erro = "URL dos Arquivos não informado.";
                return false;
            }
        }
    }
    //verifica se ja existe registro cadastrado com a informaçao passada ---
    if ($acao == "Incluir") {
        $sql = "select * from sis_param where sistema = '{$sistema}'";
        if (mysql_num_rows(execQuery($sql)) > 0) {
            $erro = "Nome do Sistema já existe no cadastro.";
            return false;
        }
    }
    //-----------------------------------------------------------------------
    return true;
}
开发者ID:jesseoliveira,项目名称:e-sic-livre-git,代码行数:32,代码来源:manutencao.php


示例4: __fetch_base_orders_info

 /**
  * Returns order_id, order_date, list<price_total, currency_code, currency_type> for each order
  */
 function __fetch_base_orders_info($order_ids)
 {
     global $application;
     if (empty($order_ids)) {
         return array();
     } else {
         $res = execQuery('SELECT_BASE_ORDERS_INFO', array("order_ids" => $order_ids));
         $orders = array();
         foreach ($res as $row) {
             if (!isset($orders[$row['order_id']])) {
                 $orders[$row['order_id']] = array("order_id" => $row['order_id'], "order_date" => $row['order_date'], "payment_status_id" => $row['payment_status_id'], "person_id" => $row['person_id'], "status_id" => $row['status_id'], "price_total" => array());
             }
             $orders[$row['order_id']]["price_total"][$row['currency_code']] = array("order_total" => $row['order_total'], "order_tax_total" => $row['order_tax_total'], "currency_code" => $row['currency_code'], "currency_type" => $row['currency_type']);
         }
         //convert currency data to checkout format
         foreach ($orders as $order_id => $info) {
             $info =& $orders[$order_id];
             $order_currencies = array();
             foreach ($info['price_total'] as $price_info) {
                 $order_currencies[] = array('currency_type' => $price_info['currency_type'], 'currency_code' => $price_info['currency_code']);
             }
             $info['order_currencies_list'] = modApiFunc("Checkout", "getOrderCurrencyList", $order_id, $order_currencies);
             unset($info);
         }
         return $orders;
     }
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:30,代码来源:checkout-manage-orders-az.php


示例5: findListBoard

function findListBoard($parentId)
{
    $strQuery = "select * from bbs_board where parentId={$parentId}";
    $result = array();
    $result = execQuery($strQuery);
    return $result;
}
开发者ID:JuneBlueberry,项目名称:JunchenBBS,代码行数:7,代码来源:board.dao.php


示例6: CheckAuthentication

/**
 * This function must check the user session to be sure that he/she is
 * authorized to upload and access files in the File Browser.
 *
 * @return boolean
 */
function CheckAuthentication()
{

    //
    // Validate the user's existing session and most privileged role.
    //
    // Sessions are stored in the database. Lookup a sesion via the cookie
    // _lis_site_session. If it's valid, extract the ckfinder_role value
    // and validate it.
    //

    $cookie = $_COOKIE['_lis_site_session'];
    $value = explode('--', $cookie);
    $value = $value[0];

    $conn = dbConnect();
    $query = mysql_real_escape_string($value);
    $session = execQuery("SELECT * FROM sessions WHERE session_id = '$query'", "dbResultToArray");

    $session_data = explode("\n", $session[0]['data']);

    $valid_roles = array("superuser", "admin");

    foreach ($session_data as $s) {
        $role = preg_replace('/[^a-z]/', '', base64_decode($s));
        for ($i = 0; $i < count($valid_roles); $i++) {
            if (strstr($role, $valid_roles[$i])) {
                return true;
            }
        }
    }

	return false;
}
开发者ID:ncgr,项目名称:lis_site,代码行数:40,代码来源:config.php


示例7: onAction

 function onAction()
 {
     global $application;
     $request = $application->getInstance('Request');
     $SessionPost = array();
     /*
     if(modApiFunc('Session', 'is_Set', 'SessionPost'))
     {
         _fatal(array( "CODE" => "CORE_050"), __CLASS__, __FUNCTION__);
     }
     */
     $SessionPost = $_POST;
     $nErrors = 0;
     $key = $request->getValueByKey('action_key');
     // @ check key
     $topics = $request->getValueByKey('topics');
     $selected_topics = explode(',', $topics);
     if (!is_array($selected_topics) || empty($selected_topics)) {
         // @ INTERNAL
         $SessionPost['ViewState']['ErrorsArray'][] = 'INTERNAL';
         $nErrors++;
     }
     modApiFunc('Subscriptions', 'copyTempEmails', $key);
     modApiFunc('Subscriptions', 'linkTempEmails', $key);
     modApiFunc('Subscriptions', 'subscribeTempEmails', $key, $selected_topics);
     modApiFunc('Subscriptions', 'cleanTempEmails', $key);
     execQuery('SUBSCR_LINK_CUSTOMER_EMAILS', null);
     execQuery('SUBSCR_LINK_ORDERS_EMAILS', null);
     modApiFunc('Session', 'set', 'SessionPost', $SessionPost);
     $request = new Request();
     $request->setView('Subscriptions_Manage');
     //        $request->setKey('stage', 'finish');
     $application->redirect($request);
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:34,代码来源:subscribe_confirm.php


示例8: order

 public static function order($name, $email = '', $phone = '', $address = '', $comment = '', $adminNotifyTplID = 'admin_purchase_notify', $customerNotifyTplID = 'user_purchase_notify')
 {
     global $db;
     $user = \cf\User::getLoggedIn();
     $productList = '';
     $products = \cf\api\cart\getList();
     if (!array_key_exists('contents', $products) || !count($products['contents'])) {
         return false;
     }
     $tpl = new MailTemplate('order');
     execQuery("\n\t\t\tINSERT INTO cf_orders (created,customer_name, customer_email, customer_phone, customer_address, customer_comments, comments)\n\t\t\tVALUES(NOW(),:name, :email, :phone, :address, :comments, :contents)", array('name' => $name, 'email' => $email, 'phone' => $phone, 'address' => $address, 'comments' => $comment, 'contents' => $tpl->parseBody(array('cart' => $products))));
     $orderId = $db->lastInsertId();
     $msgParams = array('name' => $name, 'email' => $email, 'phone' => $phone, 'address' => $address, 'comment' => $comment, 'order' => $orderId, 'total' => $products['total'], 'products' => $products['contents']);
     \cf\api\cart\clear();
     $mail = new \PHPMailer();
     $mail->CharSet = 'UTF-8';
     if ($adminNotifyTplID) {
         $tpl = new MailTemplate($adminNotifyTplID);
         $mail->Subject = $tpl->parseSubject($msgParams);
         $mail->MsgHTML($tpl->parseBody($msgParams));
         foreach ($tpl->recipients() as $address) {
             $mail->addAddress($address);
         }
         $mail->Send();
     }
     $mail->clearAddresses();
     if ($customerNotifyTplID && $email) {
         $tpl = new MailTemplate($customerNotifyTplID);
         $mail->Subject = $tpl->parseSubject($msgParams);
         $mail->MsgHTML($tpl->parseBody($msgParams));
         $mail->addAddress($email);
         $mail->Send();
     }
     return $orderId;
 }
开发者ID:sd-studio,项目名称:sh,代码行数:35,代码来源:cart.php


示例9: onAction

 function onAction()
 {
     global $application;
     $this->topics = modApiFunc('Request', 'getValueByKey', 'topic');
     if (empty($this->topics)) {
         $this->topics = array();
     }
     $SessionPost = array();
     $this->email = trim(modApiFunc('Request', 'getValueByKey', 'email'));
     if (modApiFunc('Users', 'isValidEmail', $this->email)) {
         if (modApiFunc('Subscriptions', 'canClientUnsubscribe')) {
             $ViewState = $this->changeSubscriptions();
         } else {
             $ViewState = $this->addSubscriptions();
         }
         $SessionPost['ViewState'] = $ViewState;
         if ($this->signed_in) {
             $params = array('account' => $this->account, 'email' => $this->email);
             execQuery('SUBSCR_LINK_SUBSCRIPTION_TO_CUSTOMER', $params);
         } else {
             modApiFunc('Subscriptions', 'setCustomerSubscribedEmail', $this->email);
         }
     } else {
         $SessionPost['ViewState']['ErrorsArray'][] = getMsg('SUBSCR', 'ERROR_SUBSCR_INVALID_EMAIL');
     }
     modApiFunc('Session', 'set', 'SessionPost', $SessionPost);
     $r = new Request();
     $r->setView(CURRENT_REQUEST_URL);
     $r->setAnchor('subscribe_box');
     $application->redirect($r);
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:31,代码来源:customer_subscribe.php


示例10: addCustomMenuItem

/**
 * Add a new entry in MantisBT menu (main_menu_custom_options)
 *
 * ex: addCustomMenuItem('CodevTT', '../codev/index.php')
 *
 * @param string $name
 * @param string $url
 * @return string
 */
function addCustomMenuItem($name, $url)
{
    $pos = '10';
    // invariant
    // get current mantis custom menu entries
    $query = "SELECT value FROM `mantis_config_table` WHERE config_id = 'main_menu_custom_options'";
    $result = execQuery($query);
    $serialized = 0 != mysql_num_rows($result) ? mysql_result($result, 0) : NULL;
    // add entry
    if (NULL != $serialized && "" != $serialized) {
        $menuItems = unserialize($serialized);
    } else {
        $menuItems = array();
    }
    $menuItems[] = array($name, $pos, $url);
    $newSerialized = serialize($menuItems);
    // update mantis menu
    if (NULL != $serialized) {
        $query = "UPDATE `mantis_config_table` SET value = '{$newSerialized}' " . "WHERE config_id = 'main_menu_custom_options'";
    } else {
        $query = "INSERT INTO `mantis_config_table` (`config_id`, `value`, `type`, `access_reqd`) " . "VALUES ('main_menu_custom_options', '{$newSerialized}', '3', '90');";
    }
    $result = execQuery($query);
    return $newSerialized;
}
开发者ID:fg-ok,项目名称:codev,代码行数:34,代码来源:add_to_mantis_menu.php


示例11: markRecordAsDeleted

 function markRecordAsDeleted($order_id, $order_deleted)
 {
     if ($this->isStatisticsEnable() == false) {
         return;
     }
     $params = array('order_id' => $order_id, 'order_deleted' => $order_deleted);
     execQuery('UPDATE_ORDERS_STAT_RECORD', $params);
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:8,代码来源:report_data_orders_stat_collector.php


示例12: outputCZLayoutHTTPSSettings

 function outputCZLayoutHTTPSSettings()
 {
     global $application;
     //1.                 Layout-   CZ    FS.
     //2.                    Layout-   CZ        .
     //3.        2                                  1,
     //                     .
     //4.               2.                          .
     $layouts_from_fs = LayoutConfigurationManager::static_get_cz_layouts_list();
     $layouts_from_bd = modApiFunc("Configuration", "getLayoutSettings");
     foreach ($layouts_from_fs as $fname => $info) {
         if (!array_key_exists($fname, $layouts_from_bd)) {
             execQuery('INSERT_LAYOUT_HTTPS_SETTINGS', array('layout_full_file_name' => $fname));
         }
     }
     $layouts_from_bd = modApiFunc("Configuration", "getLayoutSettings");
     if (sizeof($layouts_from_bd) > 0) {
         $CZHTTPSLayouts = "";
         foreach ($layouts_from_bd as $fname => $info) {
             $config = LayoutConfigurationManager::static_parse_layout_config_file($fname);
             if (!empty($config)) {
                 $this->_Template_Contents['CZHTTPSLayoutId'] = $info['id'];
                 //CZHTTPSLayouts
                 //CZHTTPSLayoutSections
                 $map = modApiFunc("Configuration", "getLayoutSettingNameByCZLayoutSectionNameMap");
                 $CZHTTPSLayoutSections = "";
                 $checked_sections = array();
                 foreach ($info as $key => $value) {
                     if (in_array($key, $map)) {
                         //
                         $this->_Template_Contents['_hinttext'] = gethinttext('HTTPS_FIELD_' . $key);
                         $this->_Template_Contents['CZHTTPSSectionName'] = getMsg('CFG', 'HTTPS_KEY_NAME_' . $key);
                         $this->_Template_Contents['CZHTTPSSectionKey'] = $key;
                         $this->_Template_Contents['CZHTTPSSectionValue'] = $value == DB_TRUE ? " CHECKED " : "";
                         if ($value == DB_TRUE) {
                             $checked_sections[] = $key;
                         }
                         $application->registerAttributes($this->_Template_Contents);
                         $CZHTTPSLayoutSections .= modApiFunc('TmplFiller', 'fill', "configuration/cz_https/", "section.tpl.html", array());
                     }
                 }
                 $this->_Template_Contents['CZHTTPSLayoutFileName'] = $fname;
                 $this->_Template_Contents['CZHTTPSLayoutURL'] = $config['SITE_URL'];
                 $this->_Template_Contents['CZHTTPSLayoutId'] = $info['id'];
                 $this->_Template_Contents['CZHTTPSLayoutSections'] = $CZHTTPSLayoutSections;
                 $this->_Template_Contents['CZHTTPSLayoutCheckedSections'] = implode('|', $checked_sections);
                 $application->registerAttributes($this->_Template_Contents);
                 $CZHTTPSLayouts .= modApiFunc('TmplFiller', 'fill', "configuration/cz_https/", "item.tpl.html", array());
             }
         }
         $this->_Template_Contents['CZHTTPSLayouts'] = $CZHTTPSLayouts;
         $application->registerAttributes($this->_Template_Contents);
         return modApiFunc('TmplFiller', 'fill', "configuration/cz_https/", "container.tpl.html", array());
     } else {
         //              : layout                    .
         return modApiFunc('TmplFiller', 'fill', "configuration/cz_https/", "container-empty.tpl.html", array());
     }
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:58,代码来源:https_settings_az.php


示例13: findUserById

function findUserById($id)
{
    $strQuery = "select * from bbs_user where uId = {$id}";
    $rs = execQuery($strQuery);
    if (count($rs) > 0) {
        return $rs[0];
    }
    return $rs;
}
开发者ID:JuneBlueberry,项目名称:JunchenBBS,代码行数:9,代码来源:user.dao.php


示例14: onAction

 function onAction()
 {
     global $application;
     $request = $application->getInstance('Request');
     $gc_code = $request->getValueByKey('gc_code');
     execQuery('DELETE_GC_BY_CODE', array("gc_code" => $gc_code));
     $request = new Request();
     $request->setView(CURRENT_REQUEST_URL);
     $application->redirect($request);
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:10,代码来源:GiftCertificateDellAction.php


示例15: findListReply

function findListReply($page, $topicId)
{
    $pageSize = $GLOBALS["cfg"]["server"]["page_size"];
    if ($page >= 1) {
        $page--;
    }
    $page *= $pageSize;
    $strQuery = "select * from bbs_reply r,bbs_user u where r.uId=u.uId and r.topicId={$topicId} order by publishTime desc limit {$page} , {$pageSize}";
    $rs = execQuery($strQuery);
    return $rs;
}
开发者ID:JuneBlueberry,项目名称:JunchenBBS,代码行数:11,代码来源:reply.dao.php


示例16: findListTopic

function findListTopic($page, $boardId)
{
    $pageSize = $GLOBALS["cfg"]["server"]["page_size"];
    if ($page >= 1) {
        //分页处理
        $page--;
    }
    $page *= $pageSize;
    //分页查询
    $strQuery = "select * from bbs_topic t,bbs_user u where t.uId=u.uId and boardId={$boardId} order by publishTime desc limit {$page} ,{$pageSize}";
    $rs = execQuery($strQuery);
    return $rs;
}
开发者ID:JuneBlueberry,项目名称:JunchenBBS,代码行数:13,代码来源:topic.dao.php


示例17: addRecord

 function addRecord($qty = 1)
 {
     if ($this->isStatisticsEnable() == false) {
         return;
     }
     $params = array('datetime' => date('Y-m-d H:00:00', $this->getTimestamp()), 'carts_created_qty' => $qty);
     $record = execQuery('SELECT_CARTS_STAT_RECORD_BY_PK', $params);
     if (!empty($record) and isset($record[0])) {
         $record = $record[0];
         $params['carts_created_qty'] += $record['carts_created_qty'];
     }
     execQuery('REPLACE_CARTS_STAT_RECORD', $params);
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:13,代码来源:report_data_carts_stat_collector.php


示例18: fillPropertyLocations

function fillPropertyLocations()
{
    $sql = "SELECT property_id, city, state, zip, street_number, street, county FROM property_listings WHERE IFNULL(lat, 0)=0 OR IFNULL(lon, 0)=0 LIMIT 30";
    $result = execQuery($sql);
    while ($row = mysql_fetch_assoc($result)) {
        $address = $row['street_number'] . ' ' . $row['street'] . ',' . $row['city'] . ',' . $row['state'] . ' ' . $row['zip'];
        $json = file_get_contents('http://maps.googleapis.com/maps/api/geocode/json?address=' . urlencode($address) . '&sensor=false');
        $info = json_decode($json, true);
        $info = $info['results'][0]['geometry']['location'];
        if ($info) {
            execQuery("UPDATE property_listings SET lat='{$info['lat']}', lon='{$info['lng']}' WHERE property_id='{$row['property_id']}'");
        }
    }
}
开发者ID:tolya199178,项目名称:appdownload,代码行数:14,代码来源:cron.php


示例19: FreeShippingRulesList

 function FreeShippingRulesList()
 {
     global $application;
     $this->MessageResources =& $application->getInstance('MessageResources', "shipping-cost-calculator-messages", "AdminZone");
     $this->mTmplFiller =& $application->getInstance('TmplFiller');
     $this->rulesList = execQuery('SELECT_SCC_FS_RULES', array());
     if (modApiFunc("Session", "is_Set", "SessionPost")) {
         $this->copyFormData();
         modApiFunc('Session', 'un_Set', 'SessionPost');
     } else {
         $this->initFormData();
     }
     loadCoreFile('html_form.php');
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:14,代码来源:fs-rules-list-az.php


示例20: execQueryPag

function execQueryPag($consulta)
{
    global $total;
    global $limit;
    $consulta = strtolower($consulta);
    /*$pos = strpos($consulta, "from") - 1;
    		$sql = "select count(*) as total ".substr($consulta,$pos,strlen($consulta));
    	
    		$resultado = execQuery($sql);
    		$row = mysql_fetch_assoc($resultado);
    		$total = $row["total"];*/
    $rs = execQuery($consulta);
    $total = mysql_num_rows($rs);
    return execQuery($consulta . $limit);
}
开发者ID:jesseoliveira,项目名称:e-sic-livre-git,代码行数:15,代码来源:paginacaoIni.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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