本文整理汇总了PHP中conexion::fetch_array方法的典型用法代码示例。如果您正苦于以下问题:PHP conexion::fetch_array方法的具体用法?PHP conexion::fetch_array怎么用?PHP conexion::fetch_array使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类conexion
的用法示例。
在下文中一共展示了conexion::fetch_array方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: conexion
$conn = new conexion();
include "../funciones/fechas.php";
$codfactura = $_GET["codfactura"];
$sel_alb = "SELECT * FROM facturas WHERE codfactura='{$codfactura}'";
$rs_alb = $conn->consulta($sel_alb);
$nombreCliente = mysql_result($rs_alb, 0, "nombreCliente");
$iva = mysql_result($rs_alb, 0, "iva");
$fecha = mysql_result($rs_alb, 0, "fecha");
$remito = mysql_result($rs_alb, 0, "remito");
$numfactura = mysql_result($rs_alb, 0, "numfactura");
$sel_lineas = "SELECT * FROM factulinea WHERE codfactura='{$codfactura}' ORDER BY numlinea ASC";
$rs_lineas = $conn->consulta($sel_lineas);
$fechahoy = date("Y-m-d");
$sel_albaran = "call pConsulta_codFactura()";
$rs_albaran = $conn->consulta($sel_albaran);
$resultadoFact = $conn->fetch_array($rs_albaran);
$codfacturatmp = $resultadoFact['codfactura'];
$contador = 0;
$baseimponible = 0;
while ($contador < mysql_num_rows($rs_lineas)) {
$codfamilia = mysql_result($rs_lineas, $contador, "codfamilia");
$codigo = mysql_result($rs_lineas, $contador, "codigo");
$cantidad = mysql_result($rs_lineas, $contador, "cantidad");
$precio = mysql_result($rs_lineas, $contador, "precio");
$importe = mysql_result($rs_lineas, $contador, "importe");
$baseimponible = $baseimponible + $importe;
$dcto = mysql_result($rs_lineas, $contador, "dcto");
$sel_tmp = "INSERT INTO factulineatmp (codfactura,numlinea,codfamilia,codigo,cantidad,precio,importe,dcto) VALUES ('{$codfacturatmp}','','{$codfamilia}','{$codigo}','{$cantidad}','{$precio}','{$importe}','{$dcto}')";
$rs_tmp = $conn->consulta($sel_tmp);
$contador++;
}
示例2:
if (isset($_POST['id']) || isset($_GET['id'])) {
if (isset($_POST['id'])) {
$id = $_POST['id'];
$full_name = $_POST['full_name'];
$user_name = $_POST['user_name'];
$user_email = $_POST['user_email'];
$joined = $_POST['joined'];
$rol = $_POST['rol'];
$contadorVeces = $_POST['contadorVeces'];
$user_activated = $_POST['user_activated'];
$consulta = "update users set id='" . $id . "',full_name='" . $full_name . "',user_name='" . $user_name . "',user_email='" . $user_email . "',joined='" . $joined . "',rol='" . $rol . "',user_activated='" . $user_activated . "' where id = '" . $id . "'";
$resultado = $conn->consulta($consulta);
if ($resultado != null) {
$consultaSession = "select rol from users where user_name = '" . $_SESSION['user'] . "'";
$resultadoSession = $conn->consulta($consultaSession);
$row = $conn->fetch_array($resultadoSession);
$_SESSION['rol'] = $row['rol'];
$valor = "actualizar";
} else {
$valor = "actualizar_error";
}
$query = "Select * from users order by id asc";
$seleccion = $conn->consulta($query);
}
if (isset($_GET['id'])) {
$id = $_GET['id'];
$user_name = $_GET['user_name'];
$contadorVeces = $_GET['contadorVeces'];
$consulta = "delete from users where id = '" . $id . "' and user_name = '" . $user_name . "'";
$resultado = $conn->consulta($consulta);
if ($resultado != null) {
示例3: header
<?php
session_start();
if (!isset($_SESSION['idSession'])) {
header("Location:index.php");
} else {
require "includes/sys/conexion.php";
$conn = new conexion();
$consulta = "select rol from users where user_name = '" . $_SESSION['user'] . "'";
$resultado = $conn->consulta($consulta);
$row = $conn->fetch_array($resultado);
$_SESSION['rol'] = $row['rol'];
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Menu Principal</title>
<script type="text/javascript" src="js/alertify.min.js"></script>
<script type="text/javascript" src="js/jquery-1.10.2.js"></script>
<script type="text/javascript" src="js/jquery-ui.js"></script>
<script type="text/javascript" src="js/operaciones.js"></script>
<script type="text/javascript" src="js/stickUp.min.js"></script>
<link rel="shortcut icon" type="image/png" href="css/puntoVentasImg/icon.png" />
<!-- CSS -->
<link rel="stylesheet" href="css/alertify.min.css"/>
<link rel="stylesheet" href="css/jquery-ui.css"/>
示例4:
</div>
<table class="fuente8" style="width: 55%; margin-top: 5%; margin-left: 5%;">
<tr class="cabeceraTabla">
<th>ID</th>
<th>Nombre Completo</th>
<th>Nombre Usuario</th>
<th>Contraseña</th>
<th>Correo Electronico</th>
<th>Código de Activación</th>
<th>Agregado</th>
<th>Rol</th>
<th>Estado</th>
</tr>
<?php
while ($row = @$conn->fetch_array($resultado)) {
echo '<form action="usuarios.php" id="formularioUsers" method="post">';
echo '<tr class="itemImparTabla"><td class="aCentro"><input style="width:26px;" readonly="yes" title="No se puede editar" type="text" maxlength="20" name = "id" value = "' . $row['id'] . '"/></td>
<td><input type="text" maxlength="200" name = "full_name" value = "' . $row['full_name'] . '"/></td>
<td><input style="width:100px;" type="text" maxlength="25" name = "user_name" value = "' . $row['user_name'] . '"/></td>
<td><input style="width:250px;" readonly="yes" title="No se puede editar" type="text" maxlength="50" name = "user_pwd" value = "' . $row['user_pwd'] . '"/></td>
<td><input type="text" maxlength="200" name = "user_email" value = "' . $row['user_email'] . '"/></td>
<td><input style="width:80px;" type="text" maxlength="10" readonly="yes" title="No se puede editar" name = "activation_code" value = "' . $row['activation_code'] . '"/></td>
<td><input style="width:80px;" type="text" maxlength="20" readonly="yes" title="No se puede editar" name = "joined" value = "' . $row['joined'] . '"/></td>
<td><input style="width:26px;" type="text" maxlength="2" name = "rol" value = "' . $row['rol'] . '"/></td>
<td><input style="width:26px;" type="text" maxlength="2" name = "user_activated" value = "' . $row['user_activated'] . '"/></td>
<td><input type="submit" id="bActualizarUser" value="" title="Actualizar Usuario"></td>';
echo "</form>";
echo '<td><a href="usuarios.php?id=' . $row['id'] . '&user_name=' . $row['user_name'] . '"><button id="bEliminarUser" title="Eliminar Usuario"></button></a></td></tr>';
}
示例5: conexion
include "comunesfactura.php";
require "../sys/conexion.php";
$conn = new conexion();
include "../funciones/fechas.php";
include "Numbers/Words.php";
$pdf = new PDF();
$pdf->Open();
$pdf->AddPage();
// Cabecera
if (@$GLOBALS['fondofac'] == "SI") {
$pdf->Header('./logo/$GLOBALS["imagenfac"]', 0, 0, 205, 295);
}
$codfactura = @$_GET["codfactura"];
$consulta = "Select * from facturas,clientes where facturas.codfactura='{$codfactura}' and clientes.codcliente=clientes.codcliente";
$resultado = $conn->consulta($consulta);
$lafila = @$conn->fetch_array($resultado);
$fecha = implota($lafila["fecha"]);
$dia1 = substr($fecha, 0, 2);
// El mes sale como numero
$mes1 = substr($fecha, 3, 2);
// si se activa este comando el mes sale con letras
//$mes1=mes($mes1);
$ano1 = substr($fecha, 6, 4);
$pdf->SetFillColor(255, 255, 255);
$pdf->SetTextColor(0, 0, 0);
$pdf->SetDrawColor(0, 0, 0);
$pdf->SetLineWidth(0.2);
$pdf->SetFont('courier', 'B', 10);
$pdf->Ln(15);
//el primer bloque empieza en la linea 18
$pdf->Cell(20);
示例6: count
if ($fechainicio != "") {
$where .= " and fecha>='" . $fechainicio . "'";
} else {
if ($fechafin != "") {
$where .= " and fecha<='" . $fechafin . "'";
}
}
}
$where .= " ORDER BY codfactura DESC";
$query_busqueda = "SELECT count(*) as filas FROM facturas WHERE borrado=0 AND " . $where;
$rs_busqueda = @$conn->consulta($query_busqueda);
$filas = @mysql_result($rs_busqueda, 0, "filas");
$query_busqueda = "SELECT * FROM facturas WHERE borrado=0 AND estado=1 AND " . $where;
$rs_busqueda = @$conn->consulta($query_busqueda);
$totalfacturas = 0;
while ($row = @$conn->fetch_array($rs_busqueda, MYSQL_ASSOC)) {
$totalfacturas += $row["totalfactura"];
}
?>
<html>
<head>
<meta charset="UTF-8">
<title>Facturas Clientes</title>
<link href="../estilos/estilos.css" type="text/css" rel="stylesheet">
<script language="javascript">
function ver_factura(codfactura) {
miPopup = window.open("ver_factura.php?codfactura=" + codfactura + "&cadena_busqueda=<?php
echo $cadena_busqueda;
?>
", "miwin", "width=1200,height=650,scrollbars=yes");
示例7: header
<?php
session_start();
if (!isset($_SESSION['idSession'])) {
header("Location:../../index.php");
} else {
require "../sys/conexion.php";
$conn = new conexion();
$base = @$_GET["baseimponible"];
$fechahoy = date("Y-m-d");
$sel_fact = "call pConsulta_codFactura()";
$rs_fact = $conn->consulta($sel_fact);
$resultadoFact = @$conn->fetch_array($rs_fact);
$codfacturatmp = $resultadoFact['codfactura'];
// Se actualiza a la nueva numeracion de factura
if ($GLOBALS['setnumfac'] == 1) {
$sel_articulos = "UPDATE facturastmp SET codfactura='" . $GLOBALS['numeracionfactura'] . "' WHERE codfactura='" . $codfacturatmp . "'";
$rs_articulos = $conn->consulta($sel_articulos);
$codfacturatmp = $GLOBALS['numeracionfactura'];
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Ventas</title>
<script type="text/javascript" src="../../js/alertify.min.js"></script>
<script type="text/javascript" src="../../js/jquery-1.10.2.js"></script>