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

PHP executeSql函数代码示例

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

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



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

示例1: signup

function signup($first_name, $last_name, $age, $email, $password)
{
    $sql = sprintf("SELECT user_id FROM user WHERE email = '%s'", $email);
    $exists = executeSql($sql);
    if (mysql_num_rows($exists) == 1) {
        return "exists";
    } else {
        $sql = sprintf("INSERT INTO user (first_name, last_name, age, email, password, receive_notifications, is_new, lang_id) VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')", $first_name, $last_name, $age, $email, md5($password), "0", "1", "1");
        return executeSql($sql);
    }
}
开发者ID:isader,项目名称:notgoalifyoz,代码行数:11,代码来源:login.php


示例2: createTable

 /**
  * [createTable 创建按天分表的表格 若不存在则新建 $table_yyyymmdd]
  * @param  [type] $tableName [description]
  * @param  [type] $prefix    [description]
  * @return [type]            [description]
  */
 public function createTable($tableName, $prefix)
 {
     //默认已经创建基表直接复制
     $basic = $tableName . "_basic";
     $tableName = $tableName . "_" . $prefix;
     $sql = "CREATE TABLE if not exists `" . $tableName . "` like {$basic}";
     // $this->mysqlConnect();
     // $ret = mysql_query($sql);
     $ret = executeSql($sql, false);
     return $tableName;
 }
开发者ID:rgwybb,项目名称:tars,代码行数:17,代码来源:Database.php


示例3: setModuleUserProgress

function setModuleUserProgress($user_id, $module_id, $progress, $is_complete, $date_completed)
{
    $module_already_added = isModuleAlreadyAdded($user_id, $module_id);
    if ($module_already_added) {
        return '{"status": "error", "message": "The user has already selected this module"}';
    } else {
        $sql = sprintf("INSERT INTO user_module (user_id, module_id, progress, is_complete, date_completed) VALUE ('%s', '%s', '%s', '%s', '%s')", $user_id, $module_id, $progress, $is_complete, $date_completed);
        $done = executeSql($sql);
        if ($done) {
            return '{"status": "ok", "message": "Module has been added successfully!", "module_id": ' . $module_id . '}';
        } else {
            return '{"status": "error", "message": "There was a problem while adding this module. Please try again later"}';
        }
    }
}
开发者ID:isader,项目名称:notgoalifyoz,代码行数:15,代码来源:module.php


示例4: saveBeaconData

function saveBeaconData($uuid = null)
{
    $conf = new Conf();
    global $dbConnection;
    //db credentials
    $dbInfo['host'] = $conf->dbhost;
    $dbInfo['username'] = $conf->dbuser;
    $dbInfo['password'] = $conf->dbpass;
    $dbInfo['database'] = $conf->dbname;
    $dbInfo['port'] = $conf->dbport;
    $dbConnection = createDbConnection($dbInfo['host'], $dbInfo['username'], $dbInfo['password'], $dbInfo['database'], $dbInfo['port']);
    executeSql("UPDATE `hs_hr_config` SET `value` = '{$uuid}' WHERE `key` = 'beacon.uuid'");
    executeSql("UPDATE `hs_hr_config` SET `value` = 'on' WHERE `key` = 'beacon.activiation_status'");
    mysqli_close($dbConnection);
    return true;
}
开发者ID:Molloy1000,项目名称:adjunct-hrm,代码行数:16,代码来源:registrationMessage.php


示例5: saveBeaconData

function saveBeaconData()
{
    include_once 'lib/confs/Conf.php';
    $conf = new Conf();
    global $dbConnection;
    //db credentials
    $dbInfo['host'] = $conf->dbhost;
    $dbInfo['username'] = $conf->dbuser;
    $dbInfo['password'] = $conf->dbpass;
    $dbInfo['database'] = $conf->dbname;
    $dbInfo['port'] = $conf->dbport;
    $dbConnection = createDbConnection($dbInfo['host'], $dbInfo['username'], $dbInfo['password'], $dbInfo['database'], $dbInfo['port']);
    if ($_POST['hearbeatSelect'] == 'on') {
        executeSql("UPDATE `hs_hr_config` SET `value` = 'on' WHERE `key` = 'beacon.activation_acceptance_status'");
    }
    $companyName = trim(addslashes($_POST['registerCompanyName']));
    executeSql("INSERT INTO `ohrm_organization_gen_info`(`name`) VALUES ('" . $companyName . "') ");
    mysqli_close($dbConnection);
    return true;
}
开发者ID:lahirwisada,项目名称:orangehrm,代码行数:20,代码来源:install.php


示例6: main

function main()
{
    // Cria BD e tabela
    $db = new PDO("sqlite:teste.db");
    executeSql($db, "create table cadastro(nome varchar(80) not null primary key, nascimento text not null)");
    // Limpa a tabela eliminando registros existentes
    executeSql($db, "delete from cadastro");
    // Inclui linhas na tabela
    executeSql($db, "insert into cadastro values('Maria', '2010-01-21')");
    executeSql($db, "insert into cadastro values('José', '1995-10-09')");
    executeSql($db, "insert into cadastro values('Ada', '2011-07-15')");
    // Tentativa de incluir chave primária duplicada
    executeSql($db, "insert into cadastro values('Ada', '2011-11-12')");
    // Inclusão de valor de tipo diferente do configurado para a coluna
    executeSql($db, "insert into cadastro values('Eliseu', 3.1415)");
    // Atualiza dado de uma linha
    executeSql($db, "update cadastro set nome='Maria José' where nome='Maria'");
    // Mostra conteúdo da tabela
    imprimir($db);
}
开发者ID:kwdeveloper,项目名称:crie-app-web,代码行数:20,代码来源:db_sqlite.php


示例7: MATCH

                JOIN faq_response AS fr ON
                    fr.FAQ_QuestionId = fq.Id
            WHERE MATCH(fr.Text) AGAINST(:searchQuery)
            ORDER BY fq.Text ASC
        ', ['searchQuery' => $searchQuery]);
    foreach ($answers as $answer) {
        if (!isset($resultQuestions[$answer->id])) {
            $resultQuestions[$answer->id] = ['id' => $answer->id, 'name' => $answer->text];
        }
    }
    $result = ['questions' => array_values($resultQuestions)];
    $app->response->headers->set('Content-Type', 'application/json');
    $app->response->write(json_encode($result));
});
$app->get('/questions/:id/answers', function ($id) use($app) {
    $answers = executeSql('
			SELECT
				fr.Id AS id,
				fr.Text AS text
			FROM faq_response AS fr
			WHERE fr.FAQ_QuestionId = :questionId
		', ['questionId' => $id]);
    $result = [];
    foreach ($answers as $answer) {
        $result[] = ['id' => $answer->id, 'text' => $answer->text];
    }
    $app->response->headers->set('Content-Type', 'application/json');
    $app->response->write(json_encode($result));
});
include_once 'expert_operations.php';
$app->run();
开发者ID:hydrapsy,项目名称:Blue-Economics,代码行数:31,代码来源:index.php


示例8: executeSql

                ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Zen Cart&trade; Installer</title>
<link rel="stylesheet" type="text/css" href="includes/templates/template_default/css/stylesheet.css">
</head>
<div id="wrap">
  <div id="header">
  <img src="includes/templates/template_default/images/zen_header_bg.jpg">
  </div>
<div class="progress" align="center">Installation In Progress...<br /><br />
<?php 
            }
            executeSql($_POST['db_type'] . '_zencart.sql', $_POST['db_name'], $_POST['db_prefix']);
            //update the cache folder setting:
            $sql = "update " . $_POST['db_prefix'] . "configuration set configuration_value='" . $_POST['sql_cache_dir'] . "' where configuration_key='SESSION_WRITE_DIRECTORY'";
            $db->Execute($sql);
            //update the phpbb setting:
            $sql = "update " . $_POST['db_prefix'] . "configuration set configuration_value='" . $_GET['use_phpbb'] . "' where configuration_key='PHPBB_LINKS_ENABLED'";
            $db->Execute($sql);
            $db->Close();
            // done - now onto next page for Store Setup (entries into database)
            if ($zc_show_progress == 'yes') {
                $linkto = 'index.php?main_page=store_setup&language=' . $language;
                $link = '<a href="' . $linkto . '">' . '<br /><br />Done!<br />Click Here To Continue<br /><br />' . '</a>';
                echo "\n<script type=\"text/javascript\">\nwindow.location=\"{$linkto}\";\n</script>\n";
                echo '<noscript>' . $link . '</noscript><br /><br />';
                echo '<div id="footer"><p>Copyright &copy; 2003, 2004, 2005 <a href="http://www.zen-cart.com" target="_blank">Zen Cart</a></p></div></div></body></html>';
            }
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:31,代码来源:header_php.php


示例9: queryFactory

 if (!$zc_install->fatal_error && isset($_POST['adminid']) && isset($_POST['adminpwd'])) {
     $zc_install->fileExists('sql/' . DB_TYPE . $sniffer_file, DB_TYPE . $sniffer_file . ' ' . ERROR_TEXT_DB_SQL_NOTEXIST, ERROR_CODE_DB_SQL_NOTEXIST);
     $zc_install->functionExists(DB_TYPE, ERROR_TEXT_DB_NOTSUPPORTED, ERROR_CODE_DB_NOTSUPPORTED);
     $zc_install->dbConnect(DB_TYPE, DB_SERVER, DB_DATABASE, DB_SERVER_USERNAME, DB_SERVER_PASSWORD, ERROR_TEXT_DB_CONNECTION_FAILED, ERROR_CODE_DB_CONNECTION_FAILED, ERROR_TEXT_DB_NOTEXIST, ERROR_CODE_DB_NOTEXIST);
     $zc_install->verifyAdminCredentials($_POST['adminid'], $_POST['adminpwd']);
 }
 //end if !fatal_error
 if (ZC_UPG_DEBUG2 == true) {
     echo 'Processing [' . $sniffer_file . ']...<br />';
 }
 if ($zc_install->error == false && $nothing_to_process == false) {
     //open database connection to run queries against it
     $db = new queryFactory();
     $db->Connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD, DB_DATABASE) or die("Unable to connect to database");
     // load the upgrade.sql file(s) relative to the required step(s)
     $query_results = executeSql('sql/' . DB_TYPE . $sniffer_file, DB_DATABASE, DB_PREFIX);
     if ($query_results['queries'] > 0 && $query_results['queries'] != $query_results['ignored']) {
         $messageStack->add('upgrade', $query_results['queries'] . '条指令成功执行。', 'success');
     } else {
         $messageStack->add('upgrade', '失败: ' . $query_results['queries'], 'error');
     }
     if (zen_not_null($query_results['errors'])) {
         foreach ($query_results['errors'] as $value) {
             $messageStack->add('upgrade-error-details', '忽略: ' . $value, 'error');
         }
     }
     if ($query_results['ignored'] != 0) {
         $messageStack->add('upgrade', '说明: ' . $query_results['ignored'] . '条指令未执行。详情查看 "upgrade_exceptions" 数据表。', 'caution');
     }
     /*           if (zen_not_null($query_results['output'])) {
                  foreach ($query_results['output'] as $value) {
开发者ID:dalinhuang,项目名称:cameras,代码行数:31,代码来源:header_php.php


示例10: file

                     $messageStack->add('INFO: ' . $value, 'caution');
                 }
             }
         }
     } else {
         $messageStack->add(ERROR_NOTHING_TO_DO, 'error');
     }
     break;
 case 'uploadquery':
     $upload_query = file($_FILES['sql_file']['tmp_name']);
     $query_string = $upload_query;
     if (@get_magic_quotes_runtime() > 0) {
         $query_string = zen_db_prepare_input($upload_query);
     }
     if ($query_string != '') {
         $query_results = executeSql($query_string, DB_DATABASE, DB_PREFIX);
         if ($query_results['queries'] > 0 && $query_results['queries'] != $query_results['ignored']) {
             $messageStack->add($query_results['queries'] . ' statements processed.', 'success');
         } else {
             $messageStack->add('Failed: ' . $query_results['queries'], 'error');
         }
         if (zen_not_null($query_results['errors'])) {
             foreach ($query_results['errors'] as $value) {
                 $messageStack->add('ERROR: ' . $value, 'error');
             }
         }
         if ($query_results['ignored'] != 0) {
             $messageStack->add('Note: ' . $query_results['ignored'] . ' statements ignored. See "upgrade_exceptions" table for additional details.', 'caution');
         }
         if (zen_not_null($query_results['output'])) {
             foreach ($query_results['output'] as $value) {
开发者ID:dalinhuang,项目名称:kakayaga,代码行数:31,代码来源:sqlpatch.php


示例11: dbDemoDataInstall

 function dbDemoDataInstall()
 {
     $this->dbActivate();
     // can likely remove this line for v1.4
     global $db;
     $db = $this->db;
     executeSql('demo/' . DB_TYPE . '_demo.sql', DB_DATABASE, DB_PREFIX);
 }
开发者ID:promoweb,项目名称:zc-v1-series,代码行数:8,代码来源:installer.php


示例12: executeSql

<?php

if (!mysql_num_rows(mysql_query("SHOW TABLES LIKE 'twitter'"))) {
    executeSql("plugins/tw/db.sql");
}
$sql = mysql_query("SELECT twiter FROM users");
if (!$sql) {
    mysql_query("ALTER TABLE users ADD twitter varchar(255) NOT NULL");
}
register_filter('index_icons', 'twitter_icon');
function twitter_icon($icons)
{
    return $icons . '<td align="center" width="14%" valign="top"><img src="60/twitter.png" alt="Get Twitter Followers"><br><b>Twitter Followers</b></td>';
}
register_filter('settings', 'twitter_settings');
function twitter_settings($settings)
{
    $user = mysql_query("SELECT twitter FROM `users` WHERE `username`='{$_SESSION['username']}'");
    $data = mysql_fetch_object($user);
    return $settings . 'Twitter<br/><input name="twitter" type="text" value="' . $data->twitter . '"><br/><br/>';
}
register_filter('settings_sumbit', 'twitter_settings_submit');
function twitter_settings_submit($settings)
{
    return $settings . ", `twitter` = '{$_POST['twitter']}'";
}
register_filter('top_menu_earn', 'twitter_top_menu');
function twitter_top_menu($menu)
{
    return $menu . "<li><a href='xchange.php?p=tw'>Twitter</a></li>";
}
开发者ID:danielheyman,项目名称:SocialExchangeScript,代码行数:31,代码来源:index.php


示例13: getUserById

function getUserById($user_id)
{
    $sql = sprintf("SELECT user_id, first_name, last_name, age, email, receive_notifications, is_new, lang_id FROM user WHERE user_id = '%d'", $user_id);
    return executeSql($sql);
}
开发者ID:isader,项目名称:notgoalifyoz,代码行数:5,代码来源:user.php


示例14: removeStepProgress

function removeStepProgress($step_id, $user_id)
{
    $sql = sprintf("DELETE FROM user_step WHERE user_id = '%d' AND step_id = '%d'", $user_id, $step_id);
    return executeSql($sql);
}
开发者ID:isader,项目名称:notgoalifyoz,代码行数:5,代码来源:step.php


示例15: dropDB

/**
 * 删除数据库
 *
 * @param resource $con 数据库连接
 * @param string $dbname 数据库名
 * @return array array($result, $info, $target)
 * $result 创建结果
 * $info 出错信息
 * $target 出错目标
 */
function dropDB($con, $dbname)
{
    $result = true;
    $info = '';
    $target = 'alert';
    $sql = 'DROP DATABASE `' . $dbname . '`';
    list($result, $infos) = executeSql($con, $sql);
    $info = implode("\n", $infos);
    $result = $result ? 0 : 1;
    return array($result, $info, $target);
}
开发者ID:mjrao,项目名称:BugFree,代码行数:21,代码来源:func.inc.php


示例16: function

 *
 * @param int $e_id id of the expert, e.g. 5023.
 *
 * @return json composed by questions sorted by most recent.
 */
$app->get('/get_recent_questions/:e_id', function ($e_id) use($app) {
    $recentQuestions = executeSql('
			SELECT faq_question.Id, faq_question.Text, faq_question.OccupationId, faq_question.DateCreated
			FROM faq_question
			INNER JOIN faq_questionassignment ON
				faq_questionassignment.FAQ_QuestionID = faq_question.Id
			WHERE faq_questionassignment.FAQ_ExpertID=:e_id
			ORDER BY DateCreated DESC;
        ', ['e_id' => $e_id]);
    $app->response->headers->set('Content-Type', 'application/json');
    $app->response->write(json_encode($recentQuestions));
});
/**
 * A function that will accept a like to to a specific response. (Ruben)
 *
 * @param int $e_id id of the expert, e.g. 5023.
 * @param int $r_id id of the response of another expert, e.g. 633491.
 *
 * @return none
 */
$app->get('/add_like_response/:e_id/:r_id', function ($e_id, $r_id) use($app) {
    executeSql('
        	INSERT INTO faq_responserating (`FAQ_ResponseId`, `FAQ_ExpertId`)
			VALUES (:r_id, :e_id)
        ', ['e_id' => $e_id, 'r_id' => $r_id]);
});
开发者ID:accortez,项目名称:Blue-Economics-New,代码行数:31,代码来源:expert_operations.php


示例17: file_get_contents

         }
     }
 }
 // 安装演示数据
 if (isset($_SESSION['extData']) && $_SESSION['extData'] == md5('extData')) {
     $sqlData = file_get_contents(PATH_ROOT . './install/data/installExtra.sql');
     $search = array('{time}', '{time1}', '{time2}', '{date}', '{date+1}');
     $replace = array(time(), strtotime('-1 hour'), strtotime('+1 hour'), strtotime(date('Y-m-d')), strtotime('-1 day', strtotime(date('Y-m-d'))));
     $sql = str_replace($search, $replace, $sqlData);
     executeSql($sql);
     unset($_SESSION['extData']);
 }
 // 安装工作流数据
 if (getIsInstall('workflow')) {
     $sqlFlowData = file_get_contents(PATH_ROOT . './install/data/installFlow.sql');
     executeSql($sqlFlowData);
 }
 session_destroy();
 $cacheArr = array('AuthItem', 'CreditRule', 'Department', 'Ipbanned', 'Nav', 'NotifyNode', 'Position', 'PositionCategory', 'Setting', 'UserGroup');
 foreach ($cacheArr as $cache) {
     CacheUtil::update($cache);
 }
 CacheUtil::load('usergroup');
 // 要注意小写
 CacheUtil::update('Users');
 // 因为用户缓存要依赖usergroup缓存,所以放在最后单独更新
 file_put_contents(PATH_ROOT . 'data/install.lock', '');
 $configfile = CONFIG_PATH . 'config.php';
 $config = (require $configfile);
 include 'extInfo.php';
 exit;
开发者ID:AxelPanda,项目名称:ibos,代码行数:31,代码来源:index.php


示例18: isTaskAlreadyAdded

function isTaskAlreadyAdded($user_id, $task_id)
{
    $sql = sprintf("SELECT user_task_id FROM user_task WHERE user_id = %d AND task_id = %d", $user_id, $task_id);
    $exists = executeSql($sql);
    return mysql_num_rows($exists);
}
开发者ID:isader,项目名称:notgoalifyoz,代码行数:6,代码来源:task.php


示例19: install

/**
 * 执行模块安装
 * @param string $moduleName 模块名
 * @return boolean 安装成功与否
 */
function install($moduleName)
{
    global $coreModules, $sysDependModule;
    defined('IN_MODULE_ACTION') or define('IN_MODULE_ACTION', true);
    $installPath = getInstallPath($moduleName);
    // 安装模块模型(如果有)
    $modelSqlFile = $installPath . 'model.sql';
    if (file_exists($modelSqlFile)) {
        $modelSql = file_get_contents($modelSqlFile);
        executeSql($modelSql);
    }
    // 处理模块配置,写入数据
    $config = (require $installPath . 'config.php');
    $icon = MODULE_PATH . $moduleName . '/static/image/icon.png';
    if (is_file($icon)) {
        $config['param']['icon'] = 1;
    } else {
        $config['param']['icon'] = 0;
    }
    if (!isset($config['param']['category'])) {
        $config['param']['category'] = '';
    }
    if (isset($config['param']['indexShow']) && isset($config['param']['indexShow']['link'])) {
        $config['param']['url'] = $config['param']['indexShow']['link'];
    } else {
        $config['param']['url'] = '';
    }
    $configs = json_encode($config);
    $record = array('module' => $moduleName, 'name' => $config['param']['name'], 'url' => $config['param']['url'], 'category' => $config['param']['category'], 'version' => $config['param']['version'], 'description' => $config['param']['description'], 'icon' => $config['param']['icon'], 'config' => $configs, 'installdate' => time());
    if (in_array($moduleName, $coreModules)) {
        $record['iscore'] = 1;
    } elseif (in_array($moduleName, $sysDependModule)) {
        $record['iscore'] = 2;
    } else {
        $record['iscore'] = 0;
    }
    $insertStatus = Yii::app()->db->createCommand()->insert('{{module}}', $record);
    return $insertStatus;
}
开发者ID:AxelPanda,项目名称:ibos,代码行数:44,代码来源:installFunction.php


示例20: saveSKRHistory

function saveSKRHistory($indicator, $prevdata, $nextdata, $remark, $rlogID, $table, $id)
{
    $sql1 = "INSERT INTO skr_history (sh_indicator, sh_prev_data, sh_new_data, sh_remark, sh_rlog_id, sh_table, sh_table_id, sh_tkh_upd)\n\tVALUES('{$indicator}', '{$prevdata}', '{$nextdata}', '{$remark}', '{$rlogID}', '{$table}', '{$id}', now())";
    echo executeSql($sql1);
}
开发者ID:syafiqazwan,项目名称:pharmaco,代码行数:5,代码来源:function-skr.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP executeSqlQuery函数代码示例发布时间:2022-05-15
下一篇:
PHP executeSelect函数代码示例发布时间: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