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


PHP MYSQL::SqlInsert方法代码示例

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


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

示例1: SiteCreator_css

function SiteCreator_css(&$smarty, $form = false)
{
    $mysql = new MYSQL($smarty);
    $tabela = $smarty->cfg['prefix'] . 'bilder_site';
    $mysql->SqlSelect("SELECT ID_SITE FROM {$tabela} WHERE site_dominio = '{$form['site_dominio']}'", __FILE__, __LINE__);
    if (mysql_affected_rows() > 0) {
        return $smarty->getFinishError('sitecreator_erro_01', array("", " - " . htmlspecialchars($this->form['site_dominio'])));
    }
    switch ($form['action']) {
        case "selectcss":
            $smarty->assign('ID_CSSCLASS', $form['ID_CSSCLASS']);
            return $smarty->fetch($smarty->modulo_dir . "select_css.tpl");
            break;
        default:
            $form['ID_MEMBER'] = $smarty->perfil['ID_MEMBER'];
            $sql = $mysql->SqlInsert($tabela, $form);
            $mysql->SqlSelect($sql, __FILE__, __LINE__);
            $idde = mysql_insert_id();
            $cam = './sites/' . $idde;
            //$cam = './sites/21';
            $site = new SiteCreator();
            $site->CopyDefultSite($cam);
            $site->createCfgfile($cam, array('ID_SITE' => $idde));
            $site->CopyCss($form['ID_CSS'], $cam);
            $site->createTemplates($cam, $form['site_pages']);
            unset($_POST);
            unset($_GET);
            return $smarty->getFinish('sitecreator_sucesso_01');
            break;
    }
}
开发者ID:renatoinnocenti,项目名称:ModulosZend,代码行数:31,代码来源:fnc.SiteCreator.php

示例2: NewRegistro

 function NewRegistro(&$smarty, &$form)
 {
     $this->form = $form;
     if ($e = $this->RegAgree($smarty)) {
         $error[] = $e;
     }
     if ($e = $this->RegAntiFlood($smarty)) {
         $error[] = $e;
     }
     if ($e = $this->RegUser($smarty)) {
         $error[] = $e;
     }
     if ($e = $this->RegPass($smarty)) {
         $error[] = $e;
     }
     if ($e = $this->RegEmail($smarty)) {
         $error[] = $e;
     }
     if ($e = $this->RegReservedName($smarty)) {
         $error[] = $e;
     }
     $this->form['member_registro'] = time();
     $this->form['member_ip'] = $_SERVER['REMOTE_ADDR'];
     $mysql = new MYSQL($smarty);
     $request = $mysql->SqlSelect("SELECT ID_MEMBER FROM {$smarty->cfg[prefix]}members", __FILE__, __LINE__);
     if (mysql_affected_rows() < 1) {
         $this->form['member_group'] = 'Administrador';
         $this->form['member_nivel'] = 5;
     } else {
         $this->form['member_group'] = '';
         $this->form['member_nivel'] = 1;
     }
     if (count($error) > 0) {
         foreach ($error as $saida) {
             $out .= $saida;
         }
         return $out;
     } else {
         $pass = $this->form['member_password'];
         $this->form['member_password'] = $this->md5_hmac($this->form['member_password'], strtolower($this->form['member_name']));
         $tabela = $smarty->cfg['prefix'] . 'members';
         $sql = $mysql->SqlInsert($tabela, $this->form);
         $request = $mysql->SqlSelect($sql, __FILE__, __LINE__);
         return $smarty->getFinish("registro_sucesso_01");
     }
 }
开发者ID:renatoinnocenti,项目名称:ModulosZend,代码行数:46,代码来源:lib.Registro.php

示例3: MYSQL

<?php

$tabela = 'produtos';
$mysql = new MYSQL($cfg);
if ($_POST['add']) {
    // adicionar registro.
    array_pop($_POST);
    $sql = $mysql->SqlInsert($tabela, $_POST);
    $request = $mysql->SqlSelect($sql, __FILE__, __LINE__);
    if ($request) {
        print "<h4>Registro Realizado com sucesso!!!</h4>";
    }
}
if ($_POST['del']) {
    // adicionar registro.
    $idde = trim($_POST['id']);
    $sql = $mysql->SqlDelete($tabela, "id = '{$idde}'");
    $request = $mysql->SqlSelect($sql, __FILE__, __LINE__);
    if ($request) {
        print "<h4>Registro Deletado com sucesso!!!</h4>";
    }
}
$result = $mysql->SqlSelect("SELECT id, nome, descricao, preco FROM {$tabela}");
if ($result) {
    ?>

<div class="col-md-6">
	<table class="table table-striped">
		<thead>
			<tr>
				<th>#</th>
开发者ID:renatoinnocenti,项目名称:Serviceit-php,代码行数:31,代码来源:produtos_list.php

示例4: insertTranslation

/**
 * executa um insert no banco de dados de um objeto po
 * @param unknown_type $entry
 * @param unknown_type $group
 * @return Ambigous <Ambigous, resource>
 * @todo atualizar para que o insert também faça um update
 */
function insertTranslation(&$entry, $group = 'default')
{
    global $cfg;
    $mysql = new MYSQL($cfg);
    $args = po_db($entry, $group);
    return $mysql->SqlSelect($mysql->SqlInsert($args), __FILE__, __LINE__);
}
开发者ID:renatoinnocenti,项目名称:ModulosZend,代码行数:14,代码来源:fnc.Language.php

示例5: getError

 function getError($msgerro, $tipo = false)
 {
     $valores['err_who'] = $this->perfil['ID_MEMBER'] > 0 ? $this->perfil['ID_MEMBER'] : $this->perfil['member_name'];
     $valores['err_where'] = !$this->actualpage ? serialize(array('page_name' => 'index')) : serialize($this->actualpage);
     $valores['err_type'] = $tipo == false ? FALSE : TRUE;
     $valores['err_ip'] = $_SERVER['REMOTE_ADDR'];
     $valores['err_how'] = is_array($msgerro) ? implode("</br>", $msgerro) : $msgerro;
     $mysql = new MYSQL($this);
     $tabela = $this->cfg['db_prefix'] . 'logError';
     $sql = $mysql->SqlInsert($tabela, $valores);
     //$request = $mysql->SqlSelect($sql,__FILE__,__LINE__);
     $tipo = $tipo == false ? 'ms_error' : 'ms_success';
     $this->assign('MS_ERROR_TYPE', $tipo);
     $this->assign('MS_ERROR', $this->language->translate($msgerro));
     return $this->fetch($tipo . '.tpl');
 }
开发者ID:renatoinnocenti,项目名称:ModulosZend,代码行数:16,代码来源:lib.StartSite.php


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