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


PHP sql_db::sql_query_insert_id方法代码示例

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


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

示例1: elseif

 } elseif (!empty($check_email)) {
     $error = $check_email;
 } elseif (!empty($check_pass)) {
     $error = $check_pass;
 } elseif ($password != $re_password) {
     $error = sprintf($lang_global['passwordsincorrect'], $password, $re_password);
 } elseif (empty($question)) {
     $error = $lang_module['your_question_empty'];
 } elseif (empty($answer_question)) {
     $error = $lang_module['answer_empty'];
 } else {
     $password = $crypt->hash($password);
     define('NV_CONFIG_GLOBALTABLE', $db_config['prefix'] . '_config');
     $db->sql_query("TRUNCATE TABLE `" . $db_config['prefix'] . "_users`");
     $sql = "INSERT INTO `" . $db_config['prefix'] . "_users` (`userid`, `username`, `md5username`, `password`, `email`, `full_name`, `gender`, `photo`, `birthday`, `sig`, `regdate`, `website`, `location`, `yim`, `telephone`, `fax`, `mobile`, `question`, `answer`, `passlostkey`, `view_mail`, `remember`, `in_groups`, `active`, `checknum`, `last_login`, `last_ip`, `last_agent`, `last_openid`) \n                VALUES(NULL, " . $db->dbescape($login) . ", " . $db->dbescape(md5($login)) . ", " . $db->dbescape($password) . ", " . $db->dbescape($email) . ", " . $db->dbescape($login) . ", '', '', 0, NULL, " . NV_CURRENTTIME . ", '', '', '', '', '', '', " . $db->dbescape($question) . ", " . $db->dbescape($answer_question) . ", '', 0, 1, '', 1, '', " . NV_CURRENTTIME . ", '', '', '')";
     $userid = $db->sql_query_insert_id($sql);
     $db->sql_query("TRUNCATE TABLE `" . $db_config['prefix'] . "_authors`");
     $sql = "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 ($userid > 0 and $db->sql_query($sql)) {
         $sql = array();
         $sql[] = "INSERT INTO `" . NV_CONFIG_GLOBALTABLE . "` (`lang`, `module`, `config_name`, `config_value`) VALUES ('sys', 'global', 'site_email', " . $db->dbescape_string($global_config['site_email']) . ")";
         $sql[] = "INSERT INTO `" . NV_CONFIG_GLOBALTABLE . "` (`lang`, `module`, `config_name`, `config_value`) VALUES ('sys', 'global', 'error_send_email', " . $db->dbescape_string($global_config['site_email']) . ")";
         $sql[] = "INSERT INTO `" . NV_CONFIG_GLOBALTABLE . "` (`lang`, `module`, `config_name`, `config_value`) VALUES ('sys', 'global', 'my_domains', " . $db->dbescape_string(NV_SERVER_NAME) . ")";
         $sql[] = "INSERT INTO `" . NV_CONFIG_GLOBALTABLE . "` (`lang`, `module`, `config_name`, `config_value`) VALUES ('sys', 'global', 'cookie_prefix', " . $db->dbescape_string($global_config['cookie_prefix']) . ")";
         $sql[] = "INSERT INTO `" . NV_CONFIG_GLOBALTABLE . "` (`lang`, `module`, `config_name`, `config_value`) VALUES ('sys', 'global', 'session_prefix', " . $db->dbescape_string($global_config['session_prefix']) . ")";
         $sql[] = "INSERT INTO `" . NV_CONFIG_GLOBALTABLE . "` (`lang`, `module`, `config_name`, `config_value`) VALUES ('sys', 'global', 'site_timezone', " . $db->dbescape_string($global_config['site_timezone']) . ")";
         $sql[] = "INSERT INTO `" . NV_CONFIG_GLOBALTABLE . "` (`lang`, `module`, `config_name`, `config_value`) VALUES ('sys', 'global', 'statistics_timezone', " . $db->dbescape_string(NV_SITE_TIMEZONE_NAME) . ")";
         $sql[] = "INSERT INTO `" . NV_CONFIG_GLOBALTABLE . "` (`lang`, `module`, `config_name`, `config_value`) VALUES ('sys', 'global', 'proxy_blocker', " . $db->dbescape_string($global_config['proxy_blocker']) . ")";
         $sql[] = "INSERT INTO `" . NV_CONFIG_GLOBALTABLE . "` (`lang`, `module`, `config_name`, `config_value`) VALUES ('sys', 'global', 'str_referer_blocker', " . $db->dbescape_string($global_config['str_referer_blocker']) . ")";
         $sql[] = "INSERT INTO `" . NV_CONFIG_GLOBALTABLE . "` (`lang`, `module`, `config_name`, `config_value`) VALUES ('sys', 'global', 'lang_multi', " . $db->dbescape_string($global_config['lang_multi']) . ")";
         $sql[] = "INSERT INTO `" . NV_CONFIG_GLOBALTABLE . "` (`lang`, `module`, `config_name`, `config_value`) VALUES ('sys', 'global', 'lang_geo', " . $db->dbescape_string($global_config['lang_geo']) . ")";
开发者ID:atarubi,项目名称:nuke-viet,代码行数:31,代码来源:index.php


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