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


PHP Sql::update方法代码示例

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


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

示例1: resetPassword

 static function resetPassword($data)
 {
     PDOSql::$pdobj = pdoConnect();
     $hash = Sql::esc($data['h']);
     $type = Sql::esc($data['t']);
     $email = Sql::esc($data['q']);
     $pass1 = Sql::esc($data['pass1']);
     $pass2 = Sql::esc($data['pass2']);
     if ($pass1 !== $pass2) {
         return array('success' => false, 'data' => '', 'msg' => 'Las contraseñas no coinciden');
     }
     if ($type == 'C') {
         $get_hash = "SELECT id, email, resetHash from clientes where email ='" . $email . "' AND resetHash = '" . $hash . "'";
         $delete_hash = "UPDATE clientes set password = MD5('" . $pass1 . "'), resetHash = null where email ='" . $email . "' AND resetHash = '" . $hash . "'";
     } elseif ($type == 'U') {
         $get_hash = "SELECT id, email, resetHash from usuarios where email ='" . $email . "' AND resetHash = '" . $hash . "'";
         $delete_hash = "UPDATE usuarios set password = MD5('" . $pass1 . "'), resetHash = null where email ='" . $email . "' AND resetHash = '" . $hash . "'";
     } else {
         return array('success' => false, 'data' => '', 'msg' => 'Problema con el reseteo');
     }
     $h = Sql::fetch($get_hash);
     if (count($h) == 1) {
         $u = Sql::update($delete_hash);
         return array('success' => true, 'data' => array('id' => $h[0]['id']), 'msg' => 'Se realizo la operacion con exito.');
     } else {
         return array('success' => false, 'data' => '', 'msg' => 'Codigo invalido');
     }
 }
开发者ID:scabros,项目名称:scabrosfw,代码行数:28,代码来源:Supportools.php

示例2: 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

示例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: update

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

示例6: action_move_folder

function action_move_folder($id_folder, $id_parent)
{
    Sql::update('folders', array('id_parent' => $id_parent), 'id = ?', $id_folder);
}
开发者ID:Ereaey,项目名称:Cloud,代码行数:4,代码来源:all.php

示例7: deshabilitarCategoria

 static function deshabilitarCategoria($id)
 {
     $tbl_name = "custom_cats_" . $_SESSION['clientID'];
     PDOSql::$pdobj = pdoConnect();
     $id = Sql::esc($id);
     $u = Sql::update("UPDATE {$tbl_name} SET activo = 0 WHERE id = '" . $id . "'");
     if ($u > 0) {
         return array('success' => true, 'data' => array(), 'msg' => 'Se deshabilitó la categoría personalizada');
     }
 }
开发者ID:scabros,项目名称:scabrosfw,代码行数:10,代码来源: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::update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。