本文整理汇总了PHP中Dao::query_array方法的典型用法代码示例。如果您正苦于以下问题:PHP Dao::query_array方法的具体用法?PHP Dao::query_array怎么用?PHP Dao::query_array使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dao
的用法示例。
在下文中一共展示了Dao::query_array方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
<?php
define('p_title', '.:: Actualizar Producto ::.');
include 'templates/header.php';
include "clases/Dao.php";
session_start();
if (!isset($_SESSION['acceso'])) {
header('Location: login.php');
}
$db;
$db = new Dao(array('server_ip' => 'localhost', 'server_user' => 'root', 'server_password' => '', 'server_db' => 'inventario_telematica'));
$valor = $_GET['pr_id'];
$info = $db->query_array("select * from productos where pr_id={$valor}");
$pr_categoria_array = array('', '', '', '', '');
$pr_categoria_array[$info[0]['pr_categoria']] = 'selected = "selected"';
//Colocar opcion del Select
?>
<h1>Modificar Producto</h1>
<div class="row">
<form action="mod.php" class="form" method="POST">
<div class="form-group col-xs-12">
<p class="col-xs-4">
<label for=""><span>*</span> Núm. Control</label>
<br />
<input type="text" class="form-control" value="<?php
echo $info[0]['pr_codigo'];
?>
" placeholder="Ej. 0578D" name="pr_codigo"/>
</p>
</div>
示例2: Dao
<?php
define('p_title', '.:: Listado de Productos ::.');
include 'templates/header.php';
include "clases/Dao.php";
$db;
$db = new Dao(array('server_ip' => 'localhost', 'server_user' => 'root', 'server_password' => '', 'server_db' => 'inventario_telematica'));
$datos = $db->query_array("select * from productos");
?>
<h1>Listado de Productos</h1>
<div class="table-responsive">
<table class="table table-hover">
<thead>
<th>Núm</th>
<th>Código</th>
<th>Nombre</th>
<th>$CPA</th>
<th>$VTA</th>
<th>Categoría</th>
<th>Status</th>
<th>Acciones</th>
</thead>
<tbody>
<?php
$cont = 0;
foreach ($datos as $row => $item) {
$cont++;
?>
<tr>
<td><?php
echo $cont;
示例3: header
<link rel="stylesheet" href="../bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="estilos_index.css">
</head>
<body>
<?php
$error = false;
$incompleto = false;
if (isset($_SESSION['acceso'])) {
header("location: index.php");
}
if (isset($_POST['btnlogin'])) {
if ($_POST['user'] != '' && $_POST['password'] != '') {
include "clases/Dao.php";
$db;
$db = new Dao(array('server_ip' => 'localhost', 'server_user' => 'root', 'server_password' => '', 'server_db' => 'inventario_telematica'));
$existe = $db->query_array("select * from usuarios where usuario='" . $_POST['user'] . "' and '" . $_POST['password'] . "'");
if (count($existe) > 0) {
$_SESSION['acceso'] = $existe[0];
session_start();
header("Location: index.php");
} else {
$error = true;
}
} else {
$incompleto = true;
}
}
?>
<div class="container">
<div class="jumbotron">