
Consulta por fechas
Publicado por jose (3 intervenciones) el 07/10/2015 08:21:17
Hola amigos del foro tengo un problemita con este codigo en realidad consiste en hacer consultas por medio de fechas mas, este es mi codigo en realidad me muestra el error en la linea 20 que es la siguiente
este es mi codigo completo regalenme una manita porfavor lo agradesco
en realidad no se, cual sea mi error si alguien alcanza a ver uno digame gracias
1
$resultado=$mysqli->query($query);
este es mi codigo completo regalenme una manita porfavor lo agradesco
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
include('conexion.php');
$desde = $_POST['desde'];
$hasta = $_POST['hasta'];
//COMPROBAMOS QUE LAS FECHAS EXISTAN
if(isset($desde)==false){
$desde = $hasta;
}
if(isset($hasta)==false){
$hasta = $desde;
}
//EJECUTAMOS LA CONSULTA DE BUSQUEDA
$registro="SELECT * FROM productos WHERE fecha_reg BETWEEN '$desde' AND '$hasta' ORDER BY id_prod ASC";
$resultado=$mysqli->query($query);
//CREAMOS NUESTRA VISTA Y LA DEVOLVEMOS AL AJAX
echo '<table class="table table-striped table-condensed table-hover">
<tr>
<th width="300">Nombre</th>
<th width="200">Tipo</th>
<th width="150">Precio Unitario</th>
<th width="150">Precio Distribuidor</th>
<th width="150">Fecha Registro</th>
<th width="50">Opciones</th>
</tr>';
/**if($resultado>0){*/
if($resultado>0){
/*<?php while($row=$resultado->fetch_assoc()){ ?>
*/
while($registro2 = mysql_fetch_array($resultado)){
echo '<tr>
<td>'.$registro2['nomb_prod'].'</td>
<td>'.$registro2['tipo_prod'].'</td>
<td>S/. '.$registro2['precio_unit'].'</td>
<td>S/. '.$registro2['precio_dist'].'</td>
<td>'.fechaNormal($registro2['fecha_reg']).'</td>
<td><a href="javascript:editarProducto('.$registro2['id_prod'].');" class="glyphicon glyphicon-edit"></a> <a href="javascript:eliminarProducto('.$registro2['id_prod'].');" class="glyphicon glyphicon-remove-circle"></a></td>
</tr>';a
}
}else{
echo '<tr>
<td colspan="6">No se encontraron resultados</td>
</tr>';
}
echo '</table>';
?>
en realidad no se, cual sea mi error si alguien alcanza a ver uno digame gracias
Valora esta pregunta


0