本文整理汇总了PHP中bd::doUpdate方法的典型用法代码示例。如果您正苦于以下问题:PHP bd::doUpdate方法的具体用法?PHP bd::doUpdate怎么用?PHP bd::doUpdate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bd
的用法示例。
在下文中一共展示了bd::doUpdate方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cleanMessage
error_log("Error al subir foto");
$img = "";
}
} else {
$img = $_POST['img'];
}
} else {
$img = "";
}
$message = cleanMessage($_POST['message'], $max_chars, $userid);
if (!is_numeric($message) || $message > 5) {
$fields = array('userid' => $userid, 'message' => $message, 'img' => $img, 'time_start' => $_POST['time_start'], 'time_end' => $_POST['time_end'], 'days' => $_POST['days'], 'hour' => $_POST['hour'], 'publish_fb' => $_POST['publish_fb'], 'publish_tw' => $_POST['publish_tw'], 'publish_fbp' => $_POST['publish_fbp'], 'publish_fbgp' => $_POST['publish_group']);
if (is_array($fields = makeTimes($fields))) {
if ($_POST['edit'] == true) {
unset($fields['userid']);
if ($hdb->doUpdate($table, $fields, " id=" . $hdb->quote($_POST['mes_id']) . " AND userid=" . $hdb->quote($userid))) {
$return = array("e" => 0, "c" => array("i" => $_POST['mes_id'], "m" => $fields['message'], "p" => $fields['img'], "ts_es" => formatTimeStamp($fields['time_start']), "ts_en" => date('Y-m-d', $fields['time_start']), "te_es" => formatTimeStamp($fields['time_end']), "te_en" => date('Y-m-d', $fields['time_end']), "t_p" => $fields['img'], "d" => $fields['days'], "h" => formatHour($fields['hour']), "tw" => $fields['publish_tw'], "fb" => $fields['publish_fb'], "fbp" => $fields['publish_fbp'], "gp" => $fields['publish_fbgp']));
} else {
error_log($hdb->errorInfo());
$return = array("e" => 2);
}
} else {
if ($hdb->doInsert($table, $fields)) {
$return = array("e" => 0, "c" => array("i" => $hdb->lastInsertId(), "m" => $fields['message'], "p" => $fields['img'], "ts_es" => formatTimeStamp($fields['time_start']), "ts_en" => date('Y-m-d', $fields['time_start']), "te_es" => formatTimeStamp($fields['time_end']), "te_en" => date('Y-m-d', $fields['time_end']), "t_p" => $fields['img'], "d" => $fields['days'], "h" => formatHour($fields['hour']), "tw" => $fields['publish_tw'], "fb" => $fields['publish_fb'], "fbp" => $fields['publish_fbp'], "gp" => $fields['publish_fbgp']));
} else {
error_log($hdb->errorInfo());
$return = array("e" => 2);
}
}
} else {
$return = array("e" => $fields);
示例2: bd
$fbh = new Handler_Facebook();
$hsc = new Handler_NewSocialConnection();
$db = new bd();
$permissions = ['user_posts', 'publish_actions', 'user_photos', 'manage_pages', 'publish_pages'];
if ($info = $fbh->javascriptCallbackManager($permissions)) {
$uid = $info['user_id'];
$at = $info['access_token'];
$table = "manager_fb_acc";
$condition = " user_id=" . $uid;
if ($result = $db->doSingleSelect($table, $condition)) {
//account already belongs to a user
if ($info["e"]) {
//some error, could mean a lot of things, but whichever the case we need to expire all the accounts.
$fbh->revokePermissions($at, array());
$fields = array('expires_at' => 1, 'expired' => 1);
$db->doUpdate($table, $fields, $condition);
$return = array("e" => 2);
} else {
$ea = $info['expires_at'];
$fields = array('access_token' => $at, 'expires_at' => $ea, 'expired' => 0);
$db->doUpdate($table, $fields, $condition);
switch ($login) {
case 0:
$return = array("e" => 1);
break;
case 1:
$userid = $result['userid'];
require_once "../../clases/usuarios.php";
$us = new usuario($userid);
$us->ingresoUsuarioPorID();
$hsc->clearFlow();
示例3: actualizarPublicacion
public function actualizarPublicacion($parametros, $monto, $fotos)
{
$bd = new bd();
$foto = new fotos();
$condicion = "id={$this->id}";
$params["titulo"] = ucwords(strtolower($params["titulo"]));
$result = $bd->doUpdate("publicaciones", $parametros, $condicion);
$params["monto"] = $monto;
$this->setMonto($monto);
$foto->path = "../../" . $foto->path;
$listaFotos = $bd->doFullSelect("fotosxpublicaciones", "publicaciones_id={$this->id}");
$result = $bd->query("delete from fotosxpublicaciones where publicaciones_id={$this->id}");
$ultimafoto = $bd->query("select MAX(id) as ultimo from fotos");
foreach ($ultimafoto as $key) {
$ultima = $key["ultimo"];
}
$i = 0;
$fila = 0;
foreach ($fotos as $data) {
if (substr($data, 0, 10) == "data:image") {
$i++;
$nueva = $ultima + $i;
$data_url = $data;
$data_url = str_replace(" ", "+", $data_url);
$filteredData = substr($data_url, strpos($data_url, ",") + 1);
//Decodificar la dataurl
$unencodedData = base64_decode($filteredData);
$bd->doInsert("fotos", array("id" => $nueva, "ruta" => "galeria/fotos/2015/12/"));
$bd->doInsert("fotosxpublicaciones", array("fotos_id" => $nueva, "publicaciones_id" => $this->id));
//subir la imagen
$ruta = "../../../galeria/fotos/2015/12/{$nueva}.png";
file_put_contents($ruta, $unencodedData);
} else {
$bd->doInsert("fotosxpublicaciones", array("fotos_id" => $listaFotos[$fila]["fotos_id"], "publicaciones_id" => $listaFotos[$fila]["publicaciones_id"]));
$fila++;
}
}
return true;
}
示例4: actualiza
function actualiza()
{
$bd = new bd();
$publi = new publicaciones($_POST["id"]);
$monto = $_POST["monto"];
$publi->setMonto($monto);
$bd->doUpdate("publicaciones", array("titulo" => $_POST["titulo"], "stock" => $_POST["stock"], "monto" => $monto), "id={$_POST["id"]}");
}
示例5: loadSession
function loadSession()
{
$bd = new bd();
$foto = new fotos();
if (!isset($_SESSION)) {
session_start();
}
$result = $bd->doSingleSelect("usuarios_accesos", "usuarios_id={$_POST["id"]}");
$_SESSION["id"] = $result["usuarios_id"];
$_SESSION["seudonimo"] = $result["seudonimo"];
$_SESSION["nivel"] = $result["nivel"];
$_SESSION["fotoperfil"] = $foto->buscarFotoUsuario($result["usuarios_id"]);
$_SESSION["id_rol"] = $result["id_rol"];
$bd->doUpdate("usuarios_accesos", array("bandera" => 0), "usuarios_id={$_POST["id"]}");
echo "OK";
}
示例6: setNewPassword
public function setNewPassword($user, $clave)
{
$bd = new bd();
$clave = hash("sha256", $clave);
$actualizar = array('password' => $clave);
//$parametro=$actualizar["password"]=$clave;
$condicion = "usuarios_id={$user}";
$result = $bd->doUpdate($this->a_table, $actualizar, $condicion);
return $result;
}
示例7: updateUserGeneral
public function updateUserGeneral($usuarios_id, $seudonimo = NULL, $email = NULL, $password = NULL, $id_rol = NULL)
{
$bd = new bd();
$actualizar = array('seudonimo' => $seudonimo, 'email' => $email, 'id_rol' => $id_rol);
//si cambiaron la contrase�a
if (!empty($password)) {
$password = hash("sha256", $password);
$actualizar['password'] = $password;
}
$condicion = "usuarios_id={$usuarios_id}";
$result = $bd->doUpdate($this->a_table, $actualizar, $condicion);
return $result;
}
示例8: __set
public function __set($property, $value)
{
if (property_exists($this, $property)) {
$bd = new bd();
$bd->doUpdate($this->table, array($property => $value));
$this->{$property} = $value;
}
}
示例9: json_encode
<?php
require_once "../../clases/bd.php";
$db = new bd();
session_start();
$uid = $_SESSION['id'];
$pid = $db->quote($_POST['id']);
$tw = $_POST['tw'] == 1 ? 1 : 0;
$fb = $_POST['fb'] == 1 ? 1 : 0;
$fbp = $_POST['fbp'] == 1 ? 1 : 0;
$gp = $_POST['gp'] == 1 ? 1 : 0;
$des = $_POST['des'];
$tabla = "publicaciones";
$fields = array("publicar_twitter" => $tw, "publicar_facebook" => $fb, "publicar_fanpage" => $fbp, "publicar_grupo" => $gp, "manager_des" => $des);
if ($db->doUpdate($tabla, $fields, " id={$pid} AND usuarios_id={$uid} ")) {
$return = array("e" => 0);
} else {
$return = array("e" => 1);
}
echo json_encode($return);