本文整理汇总了PHP中Query::insert方法的典型用法代码示例。如果您正苦于以下问题:PHP Query::insert方法的具体用法?PHP Query::insert怎么用?PHP Query::insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Query
的用法示例。
在下文中一共展示了Query::insert方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: insNuevoSoporte
public function insNuevoSoporte($datos)
{
$id_soporte = $this->_query->insert($datos);
if ($id_soporte) {
return $id_soporte;
} else {
return null;
}
}
示例2: insertUser
/**
* inserts the user details into the database
*/
public function insertUser()
{
$user_table = "user_details";
$add['user_name'] = $_POST['username'];
$add['first_name'] = $_POST['firstname'];
$add['last_name'] = $_POST['lastname'];
$add['age'] = date('Y') - $_POST['year'];
$add['gender'] = $_POST['gender'];
$add['password'] = md5($_POST['password']);
$add['blood_group'] = $_POST['bloodGroup'];
$add['email'] = $_POST['email'];
$add['mobile'] = $_POST['mobile'];
$interest = $_POST['interest'];
$qualification = $_POST['qualifications'];
$conn = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
$que = parent::insert($user_table, $add);
$interest_query = "update interest SET interest='{$interest}'";
$qua_query = "update qualifications SET qualification='{$qualification}'";
$result1 = mysqli_query($conn, $que) or die(mysql_error($conn));
$result2 = mysqli_query($conn, $interest_query) or die(mysqli_error($conn));
$result3 = mysqli_query($conn, $qua_query) or die(mysqli_error($conn));
if ($result1 && $result2 && $result3) {
return true;
} else {
return false;
}
}
示例3: enroll
public function enroll($post)
{
$q3 = new Query();
/*
if($post['payment_structure']==='F'){
$q3->table = 'enroll_full';
$q3->insertarray = array(
'enf_code'=> rand(100000, 999999),
'enf_tour_id'=>$post['tour_id'],
'enf_user_id'=>$uid,
'enf_amount'=>$post['tour_full_pay'],
'enf_occ'=>$post['tour_occupancy'],
'enf_hfr'=>$post['tour_hfr']
);
$q3->insert();
}else{
}
*/
$q3->table = 'enroll_full';
$q3->insertarray = array('enf_code' => rand(100000, 999999), 'enf_tour_id' => $post['tour_id'], 'enf_user_id' => $post['user_id'], 'enf_amount' => $post['tour_full_pay'], 'enf_occ' => $post['tour_occupancy'], 'enf_hfr' => $post['tour_hfr']);
$q3->insert();
$last = $q3->lastInsertId();
return $last;
}
示例4: inserting
function inserting($table, $insertarray)
{
$q = new Query();
$q->table = $table;
$q->insertarray = $insertarray;
$q->insert();
return $q->lastInsertId();
}
示例5: insertUserMobile
public function insertUserMobile()
{
$add['mobile_no'] = $_POST['mobile'];
$conn = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
$table_name = "mobile";
$db_queries = new Query();
$query = $db_queries->insert($table_name, $add);
$result1 = mysqli_query($conn, $query);
if ($result1) {
return true;
} else {
return false;
}
}
示例6: addRelation
protected function addRelation($object)
{
if (!isset($this->owner)) {
return false;
}
// can't add without
$owner = $this->owner;
$joint = static::tableJoin($owner->tableName, $object->tableName);
// get the joint table
$query = new Query($joint);
$query->insert($joint, [$owner->tableName => $owner->primaryKey, $object->tableName => $object->primaryKey]);
$key = static::query($query, $query->params);
$this->collection[] = $object;
// append to the array...
return $key;
}
示例7: createUser
/**
* Создание пользователя
* @return int userId - код нового пользователя
*/
public final function createUser(RegFormData $data)
{
$email = PsCheck::email($data->getUserMail());
//Проверим, что пользователь с таким email ещё не заведён
check_condition(!$this->hasMail($email), "Пользователь с почтой [{$email}] уже зарегистрирован");
//Подготовим поля для вставки
$params[self::FIELD_NAME] = $data->getUserName();
$params[self::FIELD_SEX] = $data->getSex();
$params[self::FIELD_EMAIL] = $email;
$params[self::FIELD_PASSWD] = self::hashPassword($data->getPassword());
$params[self::FIELD_B_ADMIN] = 0;
$params[self::FIELD_B_CAN_LOGIN] = 1;
$params[] = Query::assocParam(self::FIELD_DT_REG, 'UNIX_TIMESTAMP()', false);
//Выполняем вставку
$userId = $this->register($this->insert(Query::insert('users', $params)));
//Сохраним данные пользователя в аудит
UserAudit::inst()->afterRegistered($userId, array_filter_keys($this->getUserDataById($userId), self::$SKIP_AUDIT_ON_CREATE_FIELDS));
//Возвращаем код пользователя
return $userId;
}
示例8: insert
/**
* Create an insert query object
*
* @param string $table
* @param array $data
* @return mixed
*/
public static function insert($table, $values = array(), $handler = null)
{
return Query::insert($table, $values, $handler);
}
示例9: Query
<?php
include 'Query.inc';
$query = new Query();
$ruta = "fondos";
$archivo = $_FILES['imagen']['tmp_name'];
$nombreArchivo = $_FILES['imagen']['name'];
move_uploaded_file($archivo, $ruta . "/" . $nombreArchivo);
$ruta = $ruta . "/" . $nombreArchivo;
$admin = $query->insert("libro", "folio,nombre,autor,editorial,edicion,existencias,imagen\n\t\t\t", "'" . $_POST['folio'] . "','" . $_POST['nombre'] . "','" . $_POST['autor'] . "','" . $_POST['editorial'] . "','" . $_POST['edicion'] . "','" . $_POST['existencias'] . "','" . $ruta . "'");
if ($admin) {
$regresar = false;
echo ' <script language="javascript">alert("Registro Realizado Exitoxamente");</script> ';
$regresar = true;
if ($regresar) {
header("location:libro.php");
}
} else {
echo ' <script language="javascript">alert("Error al registrar alumno");</script> ';
}
示例10: Query
<?php
include "sources/funciones.php";
if ($_SESSION["Activa"] and $_SESSION["Tipo_usuario"] == "administrador" and $_POST) {
$propietario = __($_POST["propietario"]);
$texto = __($_POST["texto"]);
require "sources/Query.inc";
$query = new Query();
if ($query->insert("redaccion", "propietario, texto", "'{$propietario}', '{$texto}'")) {
$respuesta = '
<img src="images/ok.png" width="100">
<h4>
Saludo registrado correctamente.
</h4>
';
} else {
$respuesta = '
<img src="images/error.png" width="100">
<h4>
Ha ocurrido un error.
</h4>
';
}
?>
<!DOCTYPE html>
<html>
<head>
<?php
include 'sources/template/head.php';
?>
<meta http-equiv="Refresh" content="2;url=consultarRedaccion.php" />
示例11: Query
<?php
include 'Query.inc';
$query = new Query();
$admin = $query->insert("materia", "clave,nombre,semestre", "'" . $_POST['clave'] . "','" . $_POST['nombre'] . "','" . $_POST['semestre'] . "'");
if ($admin) {
$regresar = false;
echo ' <script language="javascript">alert("Registro Realizado Exitoxamente");</script> ';
$regresar = true;
if ($regresar) {
header("location:materia.php");
}
} else {
echo ' <script language="javascript">alert("Error al registrar alumno");</script> ';
}
示例12: Query
<?php
include 'Query.inc';
$query = new Query();
$admin = $query->insert("profesor", "rfc,nombre,apellidop,apellidom,telefono,password", "'" . $_POST['rfc'] . "','" . $_POST['nombre'] . "','" . $_POST['apellidop'] . "','" . $_POST['apellidom'] . "','" . $_POST['telefono'] . "','" . $_POST['password'] . "'");
if ($admin) {
$regresar = false;
echo ' <script language="javascript">alert("Registro Realizado Exitoxamente");</script> ';
$regresar = true;
if ($regresar) {
header("location:profesor.php");
}
} else {
echo ' <script language="javascript">alert("Error al registrar alumno");</script> ';
}
示例13: insert
function insert($data)
{
$instance = new Query($this);
$instance->insert($data);
return $instance;
}
示例14: insert
function insert($objectname, $data)
{
$query = new Query();
return $query->insert($objectname, $data);
}
示例15: array
}
$res = $res . '</div>';
$miArray = array("respuesta" => $res);
echo json_encode($miArray);
} else {
$miArray = array("error" => "No existen transacciones en este momento.");
echo json_encode($miArray);
}
} else {
if ($_POST["saveNewUser"]) {
$usu_pass = $_POST["usu_pass"];
$employee_select = $_POST["employee_select"];
$usu_email = $_POST["usu_email"];
$usu_pass = $usu_pass . "#dolancy100291#";
$query = new Query();
if ($query->insert("user_credentials", "email, password, employeeid, status", "'" . sha1(limpiaEmail($usu_email)) . "', '" . sha1(__($usu_pass)) . "', {$employee_select}, 0", "")) {
$employee = $query->select("concat(firstname,' ',lastname) as name, email, phone, address, type_employee", "employee", "employeeid = {$employee_select}", "", "obj");
if (count($employee) == 1) {
foreach ($employee as $e) {
$tipo = "";
if ($em->type_employee == 0) {
$tipo = "Vendedor";
} else {
if ($em->type_employee == 1) {
$tipo = "Gerente";
} else {
if ($em->type_employee == 2) {
$tipo = "Director";
}
}
}