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


PHP Sql::insert方法代码示例

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


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

示例1: save

 /**
  * Save Tag
  * @return bollean
  */
 public function save()
 {
     $data = array(self::ID_TAG => $this->getIdTag(), self::TAG => $this->getTag());
     $sql = new Sql();
     if (is_null($this->getIdTag())) {
         $sql->insert($data, self::TABLE);
         $this->idTag = $sql->lastRow(self::TABLE)->id_tag;
         return true;
     } else {
         $pk = array(self::ID_TAG => $this->getIdTag());
         return $sql->update($data, self::TABLE, $pk);
     }
 }
开发者ID:suga,项目名称:Megiddo,代码行数:17,代码来源:TagPeer.php

示例2: send

 static function send($pj, $msg)
 {
     $pj = Characters::get($pj);
     if (!$pj['success']) {
         return array('success' => false, 'msg' => $pj['msg']);
     } else {
         $pj = $pj['data'];
     }
     PDOSql::$pdobj = pdoConnect();
     $iduser = Sql::esc($pj['iduser']);
     $msg = Sql::esc(str_replace('{%NAME%}', $pj['name'], $msg));
     return Sql::insert("INSERT INTO notifications (iduser, msg, status) VALUES ('{$iduser}', '{$msg}', '0')");
 }
开发者ID:scabros,项目名称:scabrosfw,代码行数:13,代码来源:Notifications.php

示例3: save

 /**
  * Save 
  * @return bollean
  */
 public function save()
 {
     $data = array(self::ISOLANG => $this->getIsoLang(), self::DEFAULT_CULTURE => $this->getDefault());
     $sql = new Sql();
     if (!self::hasCulture($this->getIsoLang())) {
         $sql->insert($data, self::TABLE);
         $this->isolang = $sql->lastRow(self::TABLE)->isolang;
         return true;
     } else {
         $pk = array(self::ISOLANG => $this->getIsoLang());
         return $sql->update($data, self::TABLE, $pk);
     }
 }
开发者ID:suga,项目名称:Megiddo,代码行数:17,代码来源:CulturePeer.php

示例4: save

 /**
  * Save Log
  * @return bollean
  */
 public function save()
 {
     $data = array(self::ID => self::getId(), self::DATE => self::getDate(), self::FILE => self::getFile(), self::MESSAGE => self::getMessage(), self::IS_ERROR => self::getIsError());
     $sql = new Sql();
     if (is_null($this->getId())) {
         $sql->insert($data, self::TABLE);
         $this->id = $sql->lastRow(self::TABLE)->id;
         return true;
     } else {
         $pk = array(self::ID => self::getId());
         return $sql->update($data, self::TABLE, $pk);
     }
 }
开发者ID:suga,项目名称:Megiddo,代码行数:17,代码来源:LogPeer.php

示例5: insert

 static function insert($table, $data, $connection = 'default')
 {
     return static::query(\Sql::insert($table, $data) . ' asd', $connection);
 }
开发者ID:xtiurti,项目名称:web-service-lavanderia-encoder,代码行数:4,代码来源:sqlite.php

示例6: action_register

function action_register($login, $password, $repassword, $mail)
{
    if ($password != $repassword) {
        $d = array('success' => false, 'error' => 'password and repassword');
    } else {
        if (Sql::count('users', 'pseudo = ?', $login) > 0) {
            $d = array('success' => false, 'error' => 'login');
        } else {
            if (!filter_var($mail, FILTER_VALIDATE_EMAIL)) {
                $d = array('success' => false, 'error' => 'incorrect mail');
            } else {
                $data = array('pseudo' => $login, 'password' => $password, 'mail' => $mail);
                Sql::insert('users', $data);
                $d = array('success' => true);
            }
        }
    }
    return json_encode($d);
}
开发者ID:Ereaey,项目名称:Cloud,代码行数:19,代码来源:all.php

示例7: altaCategoria

 static function altaCategoria($data)
 {
     if (!self::tieneCatCustom($_SESSION['clientID'])) {
         self::createCatTbl($_SESSION['clientID']);
     }
     $tbl_name = "custom_cats_" . $_SESSION['clientID'];
     PDOSql::$pdobj = pdoConnect();
     $categoria = Sql::esc($data['categoria']);
     $subcat = Sql::esc($data['subcategoria']);
     $i = Sql::insert("INSERT INTO {$tbl_name} (categoria, subcategoria) values ('" . $categoria . "', '" . $subcat . "')");
     if ($i > 0) {
         return array('success' => true, 'data' => array(), 'msg' => 'Se creó la categoría personalizada');
     }
 }
开发者ID:scabros,项目名称:scabrosfw,代码行数:14,代码来源:Collections.php

示例8: save

 /**
  * Save Tag
  * @return bollean
  */
 public function save()
 {
     $data = array(self::ID_TAG_I18N => $this->getIdTagI18n(), self::ID_TAG => $this->getIdTag(), self::ISOLANG => $this->getIsoLang(), self::TRANSLATE => $this->getTranslate());
     $sql = new Sql();
     if (is_null($this->getIdTagI18n())) {
         $sql->insert($data, self::TABLE);
         $this->idTagI18n = $sql->lastRow(self::TABLE) ? $sql->lastRow(self::TABLE)->id_tag_i18n : '';
         $this->idTag = $sql->lastRow(self::TABLE) ? $sql->lastRow(self::TABLE)->id_tag : '';
         return true;
     } else {
         $pk = array(self::ID_TAG_I18N => $this->getIdTagI18n());
         return $sql->update($data, self::TABLE, $pk);
     }
 }
开发者ID:suga,项目名称:Megiddo,代码行数:18,代码来源:TagI18nPeer.php


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