当前位置: 首页>>代码示例>>PHP>>正文


PHP sql_db::exec方法代码示例

本文整理汇总了PHP中sql_db::exec方法的典型用法代码示例。如果您正苦于以下问题:PHP sql_db::exec方法的具体用法?PHP sql_db::exec怎么用?PHP sql_db::exec使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sql_db的用法示例。


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

示例1: elseif

 } elseif (empty($error)) {
     $password = $crypt->hash_password($array_data['nv_password'], $global_config['hashprefix']);
     define('NV_CONFIG_GLOBALTABLE', $db_config['prefix'] . '_config');
     $userid = 1;
     $db->query('TRUNCATE TABLE ' . $db_config['prefix'] . '_users');
     $db->query('TRUNCATE TABLE ' . $db_config['prefix'] . '_authors');
     $sth = $db->prepare("INSERT INTO " . $db_config['prefix'] . "_users\n\t\t\t\t(userid, username, md5username, password, email, first_name, last_name, gender, photo, birthday, sig,\tregdate, question, answer, passlostkey, view_mail, remember, in_groups, active, checknum, last_login, last_ip, last_agent, last_openid, idsite)\n\t\t\t\tVALUES(" . $userid . ", :username, :md5username, :password, :email, :first_name, '', '', '', 0, '', " . NV_CURRENTTIME . ", :question, :answer_question, '', 0, 1, '', 1, '', " . NV_CURRENTTIME . ", '', '', '', 0)");
     $sth->bindParam(':username', $array_data['nv_login'], PDO::PARAM_STR);
     $sth->bindValue(':md5username', nv_md5safe($array_data['nv_login']), PDO::PARAM_STR);
     $sth->bindParam(':password', $password, PDO::PARAM_STR);
     $sth->bindParam(':email', $array_data['nv_email'], PDO::PARAM_STR);
     $sth->bindParam(':first_name', $array_data['nv_login'], PDO::PARAM_STR);
     $sth->bindParam(':question', $array_data['question'], PDO::PARAM_STR);
     $sth->bindParam(':answer_question', $array_data['answer_question'], PDO::PARAM_STR);
     $ok1 = $sth->execute();
     $ok2 = $db->exec("INSERT INTO " . $db_config['prefix'] . "_authors (admin_id, editor, lev, files_level, position, addtime, edittime, is_suspend, susp_reason, check_num, last_login, last_ip, last_agent) VALUES(" . $userid . ", 'ckeditor', 1, 'adobe,application,archives,audio,documents,flash,images,real,video|1|1|1', 'Administrator', 0, 0, 0, '', '', 0, '', '')");
     if ($ok1 and $ok2) {
         try {
             $db->query('INSERT INTO ' . $db_config['prefix'] . '_users_info (userid) VALUES (' . $userid . ')');
             $db->query("INSERT INTO " . $db_config['prefix'] . "_groups_users (group_id, userid, data) VALUES(1, " . $userid . ", '0')");
             $db->query("INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'site', 'statistics_timezone', " . $db->quote(NV_SITE_TIMEZONE_NAME) . ")");
             $db->query("INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'site', 'site_email', " . $db->quote($global_config['site_email']) . ")");
             $db->query("INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'error_set_logs', " . $db->quote($global_config['error_set_logs']) . ")");
             $db->query("INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'error_send_email', " . $db->quote($global_config['site_email']) . ")");
             $db->query("INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'site_lang', '" . NV_LANG_DATA . "')");
             $db->query("INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'my_domains', " . $db->quote(NV_SERVER_NAME) . ")");
             $db->query("INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'cookie_prefix', " . $db->quote($global_config['cookie_prefix']) . ")");
             $db->query("INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'session_prefix', " . $db->quote($global_config['session_prefix']) . ")");
             $db->query("INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'site_timezone', " . $db->quote($global_config['site_timezone']) . ")");
             $db->query("INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'proxy_blocker', " . $db->quote($global_config['proxy_blocker']) . ")");
             $db->query("INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'str_referer_blocker', " . $db->quote($global_config['str_referer_blocker']) . ")");
开发者ID:anhtunguyen,项目名称:vietnamguide,代码行数:31,代码来源:index.php


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