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


PHP MySQL::fetch_array方法代码示例

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


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

示例1: refresh

    function refresh()
    {
        if (isset($_POST["User"]) and isset($_POST["pass"]) and isset($_POST["email"]) and isset($_POST["selector"]) and isset($_POST["nombre"]) and $_POST["User"] != '' and $_POST["pass"] != '' and $_POST["email"] != '' and $_POST["selector"] != '' and $_POST["nombre"] != '') {
            $conexion = new MySQL(0);
            $value = $conexion->consulta("select * from rol where usuario ='" . $_POST["selector"] . "';");
            $row = $conexion->fetch_array($value);
            $strIngreso = '	update usuario 
									set usuario = "' . $_POST["User"] . '", pass ="' . $_POST["pass"] . '",
									estatus="' . $_POST["selector3"] . '", id_rol=' . $row['ID_Rol'] . ',
									nombre ="' . $_POST["nombre"] . '",email="' . $_POST["email"] . '"
									where Id_usuario = "' . $_POST["usuario"] . '";';
            $value1 = $conexion->consulta($strIngreso);
            $conexion->MySQLClose();
            $_SESSION['value'] = 'Usuario actualizado exitosamente.';
            session_write_close();
            exit(header('Location: http://' . URL . DS . 'dashboard' . DS . 'start'));
        } else {
            $_SESSION['value'] = "error";
            session_write_close();
            exit(header('Location: http://' . URL . DS . 'usuario' . DS . 'edit'));
        }
    }
开发者ID:C0l0ch0,项目名称:BPV_WAU,代码行数:22,代码来源:usuario_old.php

示例2:

	curl_setopt($curl,CURLOPT_SSL_VERIFYPEER, false);
	$resp = curl_exec($curl);
	$servers = json_decode($resp,true);
	echo $resp;
	curl_close($curl);
	if(count($servers['servers'])>0){
		$var=0;
		for($i=0;$i<count($servers['servers']);$i++){
			if ($servers['servers'][$i]['health_status'] != 'green'){
				$var++;
			}
		}
	}*/
$strConsulta = "select cantidad from monitor where id_servicio =4";
$consulta = $conexion->consulta($strConsulta);
$row = $conexion->fetch_array($consulta);
if ($row['cantidad'] > 0) {
    //if($var>0){
    ?>
	<span class="notification red">Alarmas: <?php 
    echo $row['cantidad'];
    ?>
</span>
<?php 
} else {
    ?>
	<span class="notification green">OK</span>
<?php 
}
?>
	<div class="box-inner">
开发者ID:C0l0ch0,项目名称:BPV_WAU,代码行数:31,代码来源:guardiaD.php

示例3: obliga

            return error
            }

</script>
<br></br>
        <div align="center">
          <form name="frmhos_menus" action="./menus_cnx.php?cid_p=<?php 
echo $_GET['idp'] . '&cid_s=' . $_GET['ids'] . '&acn=' . $_GET['acn'];
?>
" method="POST" onsubmit="return obliga(this)">
               <?php 
$cid_p = $_GET['idp'];
$cid_s = $_GET['ids'];
$acn = $_GET['acn'];
$result_p = $db->consulta("select * from menup where id_mp='{$cid_p}'");
$aregistros_p = $db->fetch_array($result_p);
$menup = $aregistros_p['menup'];
if ($acn == 2) {
    $result_consulta = $db->consulta("select * from menus where id_ms='{$cid_s}'");
    while ($aregistros = $db->fetch_array($result_consulta)) {
        $menus = $aregistros['menus'];
        $urls = $aregistros['urls'];
        $ordens = $aregistros['ordens'];
        $estado = $aregistros['estado'];
        $readonly = $aregistros['readonly'];
        $readwrite = $aregistros['readwrite'];
    }
}
?>

               <table border="1" width="570px"  cellspacing="0">
开发者ID:juliocastillo,项目名称:ninfac,代码行数:31,代码来源:menus.php

示例4: MySQL

 function get_recibo_cobro_id($id_recibo)
 {
     $db = new MySQL();
     $sql = "\n            SELECT \n                r.id_documento,\n                r.id_vendedor,\n                r.n_recibo,\n                DATE_FORMAT(r.fecha_recibo,'%d/%m/%Y') fecha_recibo,\n                r.tipo_pago,\n                r.n_cheque,\n                r.banco,\n                r.monto\n            FROM\n                recibos_cxc r\n            WHERE id='{$id_recibo}'";
     return $db->fetch_array($db->consulta($sql));
 }
开发者ID:juliocastillo,项目名称:ninfac,代码行数:6,代码来源:model.php

示例5: llenarlista

 function llenarlista($sel)
 {
     $db = new MySQL();
     $sqlcommand = "SELECT id, grupo as nombre\n                        FROM grupo";
     $result = $db->consulta($sqlcommand);
     $html = "";
     while ($row = $db->fetch_array($result)) {
         /*
          * seleccionar el registro por default enviado
          */
         if ($row['id'] == $sel) {
             $html .= "<option value='" . $row['id'] . "' selected>" . htmlentities($row['nombre']) . "</option>";
         } else {
             $html .= "<option value='" . $row['id'] . "'>" . htmlentities($row['nombre']) . "</option>";
         }
     }
     return $html;
 }
开发者ID:juliocastillo,项目名称:ninfac,代码行数:18,代码来源:llenarlistas.php

示例6: while

?>
">Pre:<input type="text" size="10" name="pre_fijo" value=""><br>
                    </td>
                <tr>
                    <td>
            <input type="submit" value="Buscar">
            </td>
            </table>
        </form>
        <?php 
if ($nombre) {
    $result = $model->busqueda_cliente($nombre);
    echo "<table border='1' class='resultTable'>";
    echo "<th>Corr</th><th>ID</th><th>Nombre</th>";
    $i = 1;
    while ($row = $db->fetch_array($result)) {
        ?>
                <tr>
                    <td>
                        <?php 
        echo $i++;
        ?>
                    </td>
                    <td>
                        <?php 
        echo $row['id'];
        ?>
                    </td>
                    <td>
                        <a href="javascript:capture_id('<?php 
        echo $row['id'];
开发者ID:juliocastillo,项目名称:ninfac,代码行数:31,代码来源:busqueda_cliente.php

示例7: MySQL

<link href="../html/css/menuarbolaccesible.css" rel="stylesheet" type="text/css" />
<script src="../html/js/menuarbolaccesible.js" type="text/javascript"></script>

<?php 
?>

    <body>
    <?php 
require_once 'conexion.inc';
$db = new MySQL();
$csqlcmd = "SELECT * FROM  menup WHERE tbsistema_id=1 ORDER BY orden";
$result = $db->consulta($csqlcmd);
?>
<ul id="menu1">
    <?php 
while ($aregistros = $db->fetch_array($result)) {
    $menup = htmlentities($aregistros['menup']);
    $idp = $aregistros['id_mp'];
    ?>
    <li><?php 
    echo $menup;
    $csqlcmds = "SELECT * FROM  menus WHERE id_mp = {$idp}";
    $results = $db->consulta($csqlcmds);
    ?>
   <ul><a href="./menup.php?acn=2&idp=<?php 
    echo $idp;
    ?>
">modificar <?php 
    echo $menup;
    ?>
</a> --
开发者ID:juliocastillo,项目名称:ninfac,代码行数:31,代码来源:arbol.php

示例8: MySQL

<?php 
include "header.php";
$db = new MySQL();
$query = "select * from personal where ID=" . $_GET['ID'];
$resulto = $db->consulta($query);
while ($result = $db->fetch_array($resulto)) {
    ?>
<div id="frmaltapersonal" class="formularios" >
		<form  id="altaot" class="altas" action="ajax/abmpersonalmod.php" method="post" style="height:180px;">
			<div id="ajax_loader" style=" position:fixed; margin-top: -32px;">
	<img id="loader_gif" src="img/239.gif" style="display:none; margin-bottom:-420px; "/></div>
            <h2 align="center">Editar Personal</h2>
			<label>Apellido y Nombre:</label> <input type="text" id="nombreapellido" name="nombreapellido" value="<?php 
    echo $result['NombreApellido'];
    ?>
"/><br>
            <label>Puesto:</label> <select name="puesto">
										<?php 
    $query = "select * from puesto";
    $resulti = $db->consulta($query);
    while ($result2 = $db->fetch_array($resulti)) {
        if ($result['PuestoID'] == $result2['ID']) {
            $selp = "selected";
        } else {
            $selp = "";
        }
        echo '<option value="' . $result2['ID'] . '" ' . $selp . '>' . utf8_encode($result2['Descripcion']) . '</option>';
    }
    ?>
									</select><br>
			<label>CUIT/CUIL:</label> <input type="text" id="cuilcuit" name="cuilcuit" value="<?php 
开发者ID:zafirodev,项目名称:geot,代码行数:31,代码来源:modpersonal.php

示例9: MySQL

<?php

include "mysql.inc.php";
$files = $_REQUEST['delete'];
$dir = "../temporaty/";
$contador = 0;
//Verificamos si lo que hemos enviado es un array
if (is_array($files)) {
    for ($i = 0; $i < count($files); $i++) {
        //Creamos la estancia de conexion.
        $db = new MySQL();
        $mysqli = new mysqli("localhost", "root", "123", "practica");
        //Eliminamos el archivo antes de eliminar el registro
        $query = "SELECT nombre_image FROM tbl_temp_files WHERE id_files=" . $files[$i];
        $result = $mysqli->query($query);
        $numrows = mysqli_num_rows($result);
        //$row=$db ->consulta("SELECT nombre_image FROM tbl_temp_files WHERE id_files=".$files[$i]);
        $rows = $db->fetch_array($row);
        unlink($dir . $rows['nombre_image']);
        //Eliminamos el registro de la BD
        $query1 = "DELETE FROM tbl_temp_files WHERE id_files=" . $files[$i];
        $rows = $mysqli->query($query1);
        $contador++;
    }
    //echo "Se han eliminado los $contador registros de la BD";
    echo '<script>location.href="../";</script>';
} else {
    //echo "No se enviaron segistros para eliminar";
    echo '<script>window.alert("No se enviaron segistros para eliminar");location.href="../";</script>';
}
开发者ID:poseidonihp,项目名称:PracticaEvo,代码行数:30,代码来源:eliminar.php

示例10: MySQL

<?php

require_once '../php/conexion.php';
$correo = "armandobs94@gmail.com";
// $cc = mysqli_escape_string($correo);
//armandobs94@gmail.com
//luiyii94coty@gmail.com
$query = "SELECT P.id_post,P.id_autor,P.titulo, P.resumen,P.fecha,U.correo,U.nombre_completo,A.foto FROM post as P, usuarios as U, autores as A WHERE P.id_autor=A.id_autor AND A.id_usuario = U.id_usuario \n    AND U.correo = '{$correo}'";
$data = new MySQL(SERVER, USER, PASSW, BD);
$post = $data->consulta($query);
$registros = $data->fetch_array($post);
$num = $data->num_rows($post);
?>
<div class="col-md-2 p-izquierda">
    <div id="pImage"> 
    <img class="img-responsive thumbnail" src="<?php 
echo "../" . $registros['foto'];
?>
" alt="myImage">
        <p class="text-center">
            <strong>¡Bienvenido!</strong><br>
            <span class="blogAutor"><?php 
echo $registros['nombre_completo'];
?>
</span>
        </p>
    </div>
</div><!-- Termina columna izquierda-->

<div class="col-md-7 p-centro">
    <div class="alert alert-success" role="alert"><p class="text-center"></p></div>
开发者ID:armandobs94,项目名称:BlogInnovacionTI,代码行数:31,代码来源:miBlog.php

示例11: MySQL

<?php

include "header.php";
$id = $_GET['nroot'];
$db = new MySQL();
$query = "SELECT ot.*,e.Descripcion AS empresa,p.NombreApellido AS empleado, est.Descripcion AS estado FROM ot inner join empresas as e ON ot.Servicio_EmpresaID = e.ID INNER JOIN personal AS p ON ot.personalID = p.ID INNER JOIN estados AS est ON ot.EstadoID = est.ID WHERE ot.ID = '{$id}'";
$result = $db->consulta($query);
$Cant = $db->num_rows($result);
// obtenemos la cantidad de registros encontrados.
$resultot = $db->fetch_array($result);
?>

<div style="border: solid 1px;width: 500px;" align="center" class="formularios">
<p align="left">Se encontraron <?php 
echo $Cant;
?>
 Registros</p>
<br>
		<label>ID Cliente:</label><input type="text" value="<?php 
echo $resultot['ClientesID'];
?>
" disabled="disabled" /><br>
		<label>ID Visita:</label><input type="text" value="<?php 
echo $resultot['NumeroVisita'];
?>
" disabled="disabled" /><br>
		<label>Empresa:</label><input type="text" value="<?php 
echo $resultot['empresa'];
?>
" disabled="disabled" /><br>
		<label>Fecha Emision:</label><input type="text" value="<?php 
开发者ID:zafirodev,项目名称:geot,代码行数:31,代码来源:detalleot.php

示例12: MySQL

 function make_table($consulta)
 {
     $db = new MySQL();
     while ($row = $db->fetch_array($consulta)) {
         $tblbody .= "<tr>" . "<td>" . $row['id'] . "</td>" . "<td>" . $row['codigo'] . "</td>" . "<td>" . $row['nombre'] . "</td>" . "<td>" . $row['dir'] . "</td>" . "<td>" . $row['zona'] . "</td>" . "<td>" . "<a href='clientes.php?req=5&id=" . $row['id'] . "'>" . $row['estado'] . "</a>" . "</td>" . "<td>" . "<a href='clientes.php?req=3&id=" . $row['id'] . "'>Modificar</a>" . "</td>" . "</tr>";
     }
     return $tblbody;
 }
开发者ID:juliocastillo,项目名称:ninfac,代码行数:8,代码来源:clientes.php

示例13: generateHeader

 public function generateHeader()
 {
     $_db = new MySQL();
     $_db->connect();
     $_html = "";
     $_sql = "SELECT PacIdentificacion, PacApellido, PacNombre, PacFechaNac, GeneroDescripcion,\r\n                        OrdId, OrdTurno, DATE_FORMAT(OrdFecha, '%d-%m-%Y') AS OrdFecha, MedApellido, \r\n                        MedNombre, SalaHospDescripcion, LabAreaDescripcion, CamaDescripcion,\r\n                        CASE WHEN OrdFechaIngreso!='' AND OrdFechaIngreso!='0000-00-00 00:00:00' THEN \r\n                        DATE_FORMAT(OrdFechaIngreso, '%d-%m-%Y') ELSE '' END AS OrdFechaIngreso\r\n                 FROM {$this->_table}";
     $_db->prepare($_sql);
     $_result = $_db->execute();
     if ($_db->num_rows($_result) > 0) {
         @($data = $_db->fetch_array($_result));
         $this->setOrderId($data["OrdId"]);
         $this->setTurn($data["OrdTurno"]);
         $_html .= "<table width='100%'>";
         $_html .= "<thead>";
         $_html .= "<tr>";
         $_html .= "<td width='15%'>Paciente:</td>";
         $_html .= "<td width='25%'>" . ucwords(strtolower(utf8_encode($data["PacApellido"] . " " . $data["PacNombre"]))) . "</td>";
         $_html .= "<td width='10%'>Sala:</td>";
         $_html .= "<td width='15%'>{$data["SalaHospDescripcion"]}</td>";
         $_html .= "<td width='15%'>An&aacute;isis:</td>";
         $_html .= "<td width='20%'>{$data["OrdTurno"]}</td>";
         $_html .= "</tr>";
         $_html .= "<tr>";
         $_html .= "<td>Fecha Orden:</td>";
         $_html .= "<td>{$data["OrdFecha"]}</td>";
         $_html .= "<td>Cama:</td>";
         $_html .= "<td>{$data["CamaDescripcion"]}</td>";
         $_html .= "<td>CI:</td>";
         $_html .= "<td>{$data["PacIdentificacion"]}</td>";
         $_html .= "</tr>";
         $_html .= "<tr>";
         $_html .= "<td>Fecha Ingreso:</td>";
         $_html .= "<td>{$data["OrdFechaIngreso"]}</td>";
         $_html .= "<td>Area:</td>";
         $_html .= "<td>{$data["LabAreaDescripcion"]}</td>";
         $_html .= "<td>Edad:</td>";
         $_html .= "<td>" . Util::getAge($data["PacFechaNac"]) . " a&ntilde;os</td>";
         $_html .= "</tr>";
         $_html .= "<tr>";
         $_html .= "<td>Medico:</td>";
         $_html .= "<td>" . ucwords(strtolower(utf8_encode($data["MedApellido"] . " " . $data["MedNombre"]))) . "</td>";
         $_html .= "<td></td>";
         $_html .= "<td></td>";
         $_html .= "<td>Sexo:</td>";
         $_html .= "<td>" . ucwords(strtolower($data["GeneroDescripcion"])) . "</td>";
         $_html .= "</tr>";
         $_html .= "</thead>";
         $_html .= "</table>";
     }
     return $_html;
 }
开发者ID:atoledov,项目名称:siglab,代码行数:51,代码来源:Orders.php

示例14: MySQL

 function make_table($consulta, $id_documento)
 {
     $db = new MySQL();
     $tblbody = "<table style='width: 900px; border-collapse:collapse' border='1'>";
     $tblbody .= "<thead>D e t a l l e</thead>";
     $tblbody .= "<tr>";
     $tblbody .= "<td style='background-color: #FFCC99'>Corr</td>";
     $tblbody .= "<td style='background-color: #FFCC99'>Tipo entrada</td>";
     $tblbody .= "<td style='background-color: #FFCC99'>Producto</td>";
     $tblbody .= "<td style='background-color: #FFCC99'>Lote</td>";
     $tblbody .= "<td style='background-color: #FFCC99'>Presentacion</td>";
     $tblbody .= "<td style='background-color: #FFCC99'>Cantidad</td>";
     $tblbody .= "<td style='background-color: #FFCC99'>Precio unitario</td>";
     $tblbody .= "</tr>";
     $i = 0;
     while ($row = $db->fetch_array($consulta)) {
         $i++;
         $tblbody .= "<tr>" . "<td>" . $i . "</td>" . "<td style='text-align: center'>" . $row['tipo_entrada'] . "</td>" . "<td>" . "<a href='entrada_producto_terminado.php?req=3&id=" . $row['id'] . "'>" . $row['nombre_producto'] . "</a></td>" . "<td style='text-align: right'>" . $row['lote'] . "</td>" . "<td style='text-align: right'>" . $row['presentacion'] . "</td>" . "<td style='text-align: right'>" . $row['cantidad'] . "</td>" . "<td style='text-align: right'>" . $row['precio_unit'] . "</td>" . "</tr>";
     }
     $tblbody .= "</table>";
     return $tblbody;
 }
开发者ID:juliocastillo,项目名称:ninfac,代码行数:22,代码来源:entrada_producto_terminado.php

示例15: MySQL

 function make_table($consulta)
 {
     $db = new MySQL();
     while ($row = $db->fetch_array($consulta)) {
         $tblbody .= "<tr>" . "<td>" . $row['codigo'] . "</td>" . "<td>" . $row['id_grupo'] . "</td>" . "<td><a href='productos.php?req=3&id=" . $row['id'] . "'>" . $row['nombre'] . "</td>" . "<td>" . $row['presentacion'] . "</td>" . "<td>" . $row['precio_cls_iva'] . "</td>" . "<td>" . $row['precio_clc_iva'] . "</td>" . "<td>" . $row['precio_pc_iva'] . "</td>" . "<td> <input style='text-align: right' name='precio_costo[]' id='precio_costo' value='" . $row['precio_costo'] . "' size='10px'" . "onblur='runajax(\"producto_ajax.php?id={$row['id']}&precio_costo=\"+this.value,\"div_mess\")'></td>" . "<td>" . $row['vineta'] . "</td>" . "</tr>";
     }
     return $tblbody;
 }
开发者ID:juliocastillo,项目名称:ninfac,代码行数:8,代码来源:productos.php


注:本文中的MySQL::fetch_array方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。