Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $salida = "";
- $query = "SELECT * FROM productos ORDER By ID";
- $cantidad = 0;
- //$Unidad = $fila['ProductU'];
- if(isset($_POST['e']) && isset($_POST['c'])){
- $q = $conexion->real_escape_string($_POST['e']);
- $query = "SELECT ID, ProductN, ProductP, ProductU, ProductS FROM productos WHERE ID LIKE '%".$q."%'";
- $cantidad = $_POST['c'];
- }
- $resultado = $conexion->query($query);
- $salida.="<table class='table table-sm' id='tabla' autofocus>
- <thead class='thead-light'>
- <tr>
- <th scope='col'>Cantidad</th>
- <th scope='col'>Unid.</th>
- <th scope='col'>ARTICULO</th>
- <th scope='col'>P. Unitario</th>
- <th>TOTAL</th>
- </tr>
- </thead>
- <tbody>";
- $fila = $resultado->fetch_assoc();
- $salida.="<tr>
- <td>".$cantidad."</td>
- <td>".$fila['ProductU']."</td>
- <td>".$fila['ProductN']."</td>
- <td>".$fila['ProductP']."</td>
- <td>40</td>
- </tr>";
- //if($resultado->num_rows > 0){
- // $i
- //for($i=1; $i<4; $i++){
- // echo "hola";
- //}
- //while($fila = $resultado->fetch_assoc()){
- //}
- $salida.="</tbody</table>";
- echo $salida;
- $conexion->close();
- ?>
Add Comment
Please, Sign In to add comment