本文整理汇总了PHP中Mysql::conexion方法的典型用法代码示例。如果您正苦于以下问题:PHP Mysql::conexion方法的具体用法?PHP Mysql::conexion怎么用?PHP Mysql::conexion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mysql
的用法示例。
在下文中一共展示了Mysql::conexion方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Mysql
<?php
session_start();
//
require '../config/classes.php';
$class = new Mysql();
$username = mysqli_real_escape_string($class->conexion(), $_GET['username']);
$password = mysqli_real_escape_string($class->conexion(), $_GET['password']);
$login = mysqli_query($class->conexion(), "SELECT * FROM account.account where login='" . $username . "' and password=PASSWORD('" . $password . "')");
$rows = mysqli_fetch_array($login, MYSQLI_ASSOC);
if ($rows['id']) {
$_SESSION['web_admin'] = $rows['web_admin'];
$_SESSION['id'] = $rows['id'];
$_SESSION['login'] = $rows['login'];
$_SESSION['email'] = $rows['email'];
$_SESSION['social_id'] = $rows['social_id'];
$_SESSION['country'] = $rows['zipcode'];
$_SESSION['status'] = $rows['status'];
$_SESSION['last_play'] = $rows['last_play'];
$_SESSION['pic'] = $rows['pic'];
echo "ok";
} else {
return false;
}
示例2: registrar
public function registrar()
{
$mysql = new Mysql();
$mysql->conexion();
$consulta = $mysql->consulta("INSERT INTO empleados values ('{$this->cedula}','{$this->nombre}','{$this->apellido}','{$this->emailp}','{$this->emailc}','{$this->skype}','{$this->direccion}','{$this->telefono}','{$this->celular}','{$this->fechae}','{$this->fechac}','{$this->contactoe}','{$this->parentezco}','{$this->telefonoc}','{$this->eps}','{$this->cargo}','{$this->proyectoa}')");
}
示例3: Mysql
<?php
//please try to comment code in english
include "mysql.php";
if (isset($_REQUEST['pos'])) {
$inicio = $_REQUEST['pos'];
} else {
$inicio = 0;
}
$mysql = new Mysql();
$mysql->conexion();
// Creamos la variable consulta que nos servira como argumento en los metodos num_rows y fetch_array
$consulta = $mysql->consulta("SELECT * from empleados limit {$inicio},3");
//si existe por lo menos un campo
if ($mysql->num_rows($consulta) > 0) {
echo "se encontraron valores";
//Guardaremos en la variable $resultado en Array que nos devuelva
?>
<table id="resultados" border=1px>
<tr><td>Cedula</td><td>nombre</td><td>telefono y celular</td><td>Cedula</td><td>Cedula</td><td>Cedula</td></tr>
<?php
$impresos = 0;
while ($resultado = $mysql->fetch_array($consulta)) {
$impresos++;
?>
<tr><td><?php
echo $resultado['Cedula'];
?>
</td><td><?php
echo $resultado['Nombres'];
?>
示例4: Mysql
<?php
require '../config/classes.php';
$class = new Mysql();
$username = mysqli_real_escape_string($class->conexion(), $_GET['username']);
$password = mysqli_real_escape_string($class->conexion(), $_GET['password']);
$socialid = mysqli_real_escape_string($class->conexion(), $_GET['socialid']);
$email = mysqli_real_escape_string($class->conexion(), $_GET['email']);
$pais = mysqli_real_escape_string($class->conexion(), $_GET['pais']);
$captcha = mysqli_real_escape_string($class->conexion(), $_GET['captcha']);
if (isset($_GET['username'])) {
$check = mysqli_query($class->conexion(), "SELECT id from account.account where login='" . $username . "'");
$rows = mysqli_fetch_array($check, MYSQLI_ASSOC);
if ($rows['id']) {
echo "exist";
} else {
$sql = mysqli_query($class->conexion(), "INSERT INTO account.account (login,password,social_id,email,zipcode) VALUES ('" . $username . "',PASSWORD('" . $password . "'),'" . $socialid . "','" . $email . "','" . $pais . "')");
echo "ok";
}
}
示例5: Mysql
<?php
session_start();
require 'config/classes.php';
$conn = new Mysql();
if (!empty($_FILES)) {
if (is_uploaded_file($_FILES['userImage']['tmp_name'])) {
$path = md5(date("d.m.YH:i:s"));
//obtenemos el archivo a subir
$peso = $_FILES['userImage']['size'];
$file = $_FILES['userImage']['name'];
$sourcePath = $_FILES['userImage']['tmp_name'];
$imagen = getimagesize($sourcePath);
$ancho = $imagen[0];
//Ancho
$alto = $imagen[1];
//Alto
if ($file && $peso <= 70720 && $ancho <= 150 && $alto <= 150) {
if (move_uploaded_file($_FILES['userImage']['tmp_name'], "img/avatars/" . $path . ".jpg")) {
sleep(3);
//retrasamos la petición 3 segundos
mysqli_query($conn->conexion(), "UPDATE account.account set pic='" . $path . "' where id='" . $_SESSION['id'] . "' LIMIT 1");
?>
<?php
}
}
}
}