當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。