Guest User

Untitled

a guest
Mar 24th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. $salida = "";
  2. $query = "SELECT * FROM productos ORDER By ID";
  3. $cantidad = 0;
  4.  
  5. //$Unidad = $fila['ProductU'];
  6.  
  7. if(isset($_POST['e']) && isset($_POST['c'])){
  8. $q = $conexion->real_escape_string($_POST['e']);
  9. $query = "SELECT ID, ProductN, ProductP, ProductU, ProductS FROM productos WHERE ID LIKE '%".$q."%'";
  10. $cantidad = $_POST['c'];
  11. }
  12.  
  13. $resultado = $conexion->query($query);
  14. $salida.="<table class='table table-sm' id='tabla' autofocus>
  15. <thead class='thead-light'>
  16. <tr>
  17. <th scope='col'>Cantidad</th>
  18. <th scope='col'>Unid.</th>
  19. <th scope='col'>ARTICULO</th>
  20. <th scope='col'>P. Unitario</th>
  21. <th>TOTAL</th>
  22. </tr>
  23. </thead>
  24. <tbody>";
  25. $fila = $resultado->fetch_assoc();
  26. $salida.="<tr>
  27. <td>".$cantidad."</td>
  28. <td>".$fila['ProductU']."</td>
  29. <td>".$fila['ProductN']."</td>
  30. <td>".$fila['ProductP']."</td>
  31. <td>40</td>
  32. </tr>";
  33. //if($resultado->num_rows > 0){
  34. // $i
  35. //for($i=1; $i<4; $i++){
  36. // echo "hola";
  37. //}
  38. //while($fila = $resultado->fetch_assoc()){
  39.  
  40.  
  41. //}
  42.  
  43. $salida.="</tbody</table>";
  44.  
  45.  
  46. echo $salida;
  47. $conexion->close();
  48.  
  49. ?>
Add Comment
Please, Sign In to add comment