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


PHP SafeMySQL::parse方法代码示例

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


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

示例1: array

 }
 $re_id = $o->getOne('SELECT user_id FROM users WHERE email=?s AND password=?s', $x['email'], $x['password']);
 if ($re_id) {
     $res = array('head' => '<div id="material_null">
                             <p>Вы уже зарегистрированы.</p>
                         </div>');
     array_push($arr, $res);
     print json_encode($arr);
     exit;
 }
 //Данных нет, отлично, ищем в таблице регистрации
 if ($x['password'] == $_SESSION['registration_password'] && $x['email'] == $_SESSION['registration_email']) {
     //Создаем транзакцию, чтобы данные попали во все нужны таблицы
     $load = $o->transactionQuery();
     mysqli_autocommit($load, false);
     $t1 = mysqli_query($load, $o->parse("INSERT INTO users (email,password) VALUES (?s,?s)", $x['email'], $x['password']));
     mysqli_query($load, $o->parse("SET @lastID := LAST_INSERT_ID();"));
     $t2 = mysqli_query($load, $o->parse("INSERT INTO users_information (user_id,nickname,category) VALUES (@lastID,?s,?s)", $x['nickname'], $x['category']));
     $t3 = mysqli_query($load, $o->parse("INSERT INTO users_online (user_id,online) VALUES (@lastID,'offline')"));
     if ($t1 && $t2 && $t3) {
         mysqli_commit($load);
         $res = array('head' => '<div id="none"><p>Вы зарегистрированы! Теперь можно попробовать войти на сайт.</p></div>');
         array_push($arr, $res);
         $o->query("DELETE FROM users_registration WHERE key_reg=?s", $category);
         unset($_SESSION['registration_email'], $_SESSION['registration_password'], $key_reg);
     } else {
         mysqli_rollback($load);
         $res = array('head' => '<div id="material_null">
                 <p>Что-то пошло не так.</p>
             </div>');
         array_push($arr, $res);
开发者ID:alexander-shibisty,项目名称:subscribeonme,代码行数:31,代码来源:block.php

示例2: mktime

        resize_pic($_FILES["file"]["tmp_name"], "800", "600", "../upload/catalog/800-600/" . $filename);
        crop_preview($_FILES["file"]["tmp_name"], "200", "../upload/catalog/200-200/" . $filename);
    }
    $add_catalog = $db->query("INSERT INTO " . DB_PREFIX . "_catalog SET ?u", $data);
    if ($add_catalog && $_FILES["file"]["error"] == 0) {
        $message = 'Организация добавлена';
    } else {
        $error = 'Возникла ошибка при добавлении организации';
    }
}
// Изменение организации
if ($_POST['update']) {
    $filename = mktime() . '.jpg';
    $sqlpart = '';
    if (!empty($_FILES["file"]["name"])) {
        $sqlpart = $db->parse(" file='" . $filename . "',");
    }
    $data = array('title' => $_POST['title'], 'url' => translit($_POST['title']), 'form' => $_POST['form'], 'type' => $_POST['type'], 'category' => $_POST['category'], 'boss' => $_POST['boss'], 'description' => $_POST['description'], 'phone' => $_POST['phone'], 'phone2' => $_POST['phone2'], 'fax' => $_POST['fax'], 'email' => $_POST['fax'], 'www' => $_POST['www'], 'city' => $_POST['city'], 'street' => $_POST['street'], 'build' => $_POST['build'], 'lat' => explode(', ', $_POST['coord'])['0'], 'lon' => explode(', ', $_POST['coord'])['1']);
    $update_catalog = $db->query("UPDATE " . DB_PREFIX . "_catalog SET ?p ?u WHERE id=?i", $sqlpart, $data, $_POST['id']);
    if (!empty($_FILES["file"]["name"])) {
        file_upload(array("jpeg", "jpg"), "image/jpeg", "../upload/catalog/original/" . mktime() . ".jpg");
        resize_pic($_FILES["file"]["tmp_name"], "800", "600", "../upload/catalog/800-600/" . mktime() . ".jpg", "75");
        crop_preview($_FILES["file"]["tmp_name"], "200", "../upload/catalog/200-200/" . mktime() . ".jpg", "75");
    }
    if ($update_catalog) {
        $message = 'Данные организации обновлены';
    } else {
        $error = 'Возникла ошибка при обновлении данных организации';
    }
}
// удаление организации
开发者ID:rad-li,项目名称:Cafe-CMS,代码行数:31,代码来源:index.php

示例3: int

\$set->db_name = '{$name}'; // database name

define('MLS_PREFIX', '{$prefix}');  

EEE;
    // add the data to the file
    if (!file_put_contents('inc/settings.php', $data)) {
        $page->error = "There is an error with inc/settings.php make sure it is writable.";
    }
    $sqls[] = "\n  CREATE TABLE IF NOT EXISTS `" . $prefix . "banned` (\n  `userid` int(11) NOT NULL,\n  `until` int(11) NOT NULL,\n  `by` int(11) NOT NULL,\n  `reason` varchar(255) NOT NULL,\n  UNIQUE KEY `userid` (`userid`)\n) ENGINE=InnoDB DEFAULT CHARSET=latin1;";
    $sqls[] = "\n  CREATE TABLE IF NOT EXISTS `" . $prefix . "groups` (\n  `groupid` int(11) NOT NULL AUTO_INCREMENT,\n  `name` varchar(255) NOT NULL,\n  `type` int(11) NOT NULL,\n  `priority` int(11) NOT NULL,\n  `color` varchar(50) NOT NULL,\n  `canban` int(11) NOT NULL,\n  `canhideavt` int(11) NOT NULL,\n  `canedit` int(11) NOT NULL,\n  PRIMARY KEY (`groupid`)\n) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;\n";
    $sqls[] = "\n  INSERT INTO `" . $prefix . "groups` (`groupid`, `name`, `type`, `priority`, `color`, `canban`, `canhideavt`, `canedit`) VALUES\n(1, 'Guest', 0, 1, '', 0, 0, 0),\n(2, 'Member', 1, 1, '#08c', 0, 0, 0),\n(3, 'Moderator', 2, 1, 'green', 1, 1, 0),\n(4, 'Administrator', 3, 1, '#F0A02D', 1, 1, 1);";
    $sqls[] = "\n  CREATE TABLE IF NOT EXISTS `" . $prefix . "privacy` (\n  `userid` int(11) NOT NULL,\n  `email` int(11) NOT NULL,\n  UNIQUE KEY `userid` (`userid`)\n) ENGINE=InnoDB DEFAULT CHARSET=latin1;";
    $sqls[] = "\n  INSERT INTO `" . $prefix . "privacy` (`userid`, `email`) VALUES (1, 0);";
    $sqls[] = "\n  CREATE TABLE IF NOT EXISTS `" . $prefix . "settings` (\n  `site_name` varchar(255) NOT NULL DEFAULT 'Demo Site',\n  `url` varchar(300) NOT NULL,\n  `admin_email` varchar(255) NOT NULL,\n  `max_ban_period` int(11) NOT NULL DEFAULT '10',\n  `register` int(11) NOT NULL DEFAULT '1',\n  `email_validation` int(11) NOT NULL DEFAULT '0',\n  `captcha` int(11) NOT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=latin1;";
    $sqls[] = $db->parse("\n  INSERT INTO `" . $prefix . "settings` (`site_name`, `url`, `admin_email`, `max_ban_period`, `register`, `email_validation`, `captcha`) VALUES\n(?s, ?s, 'nor.reply@gmail.com', 10, 1, 0, 1);", $_POST['sitename'], $_POST['siteurl']);
    $sqls[] = "\n  CREATE TABLE IF NOT EXISTS `" . $prefix . "users` (\n  `userid` int(11) NOT NULL AUTO_INCREMENT,\n  `username` varchar(50) NOT NULL,\n  `display_name` varchar(255) NOT NULL,\n  `password` varchar(50) NOT NULL,\n  `email` varchar(255) NOT NULL,\n  `key` varchar(50) NOT NULL,\n  `validated` varchar(100) NOT NULL,\n  `groupid` int(11) NOT NULL DEFAULT '2',\n  `lastactive` int(11) NOT NULL,\n  `showavt` int(11) NOT NULL DEFAULT '1',\n  `banned` int(11) NOT NULL,\n  `regtime` int(11) NOT NULL,\n  PRIMARY KEY (`userid`)\n) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;";
    $sqls[] = "\n  INSERT INTO `" . $prefix . "users` (`userid`, `username`, `display_name`, `password`, `email`, `key`, `validated`, `groupid`, `lastactive`, `showavt`, `banned`, `regtime`) VALUES\n(1, 'admin', 'Admin', '7110eda4d09e062aa5e4a390b0a572ac0d2c0220', 'admin@gmail.com', '', '1', 4, " . time() . ", 1, 0, " . time() . ");";
    foreach ($sqls as $sql) {
        if (!isset($page->error) && !$db->query("?p", $sql)) {
            $page->error = "There was a problem while executing <code>{$sql}</code>";
        }
    }
    if (!isset($page->error)) {
        $page->success = "The installation was successful ! Thank you for using master loging system and we hope you enjo it ! Have fun ! <br/><br/>\n    <a class='btn btn-success' href='./index.php'>Start exploring</a>\n    <br/><br/>\n\n    <h3>USER: admin <br/> PASSWORD: 1234</h3>";
    }
}
?>
<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
开发者ID:amoskarugaba,项目名称:master-login-system,代码行数:31,代码来源:install.php


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