test1.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. Esto es un div
  2. <?php
  3. include('db.php');
  4. $statement = $db->prepare("SELECT d.nombre, d.telefono, d.direccion, d.localidad, d.provincia, c.categoria
  5. FROM distribuidoras d
  6. left join categorias_distribuidoras c
  7. on d.categoria = c.id
  8. where d.categoria = 2");
  9. $statement->execute();
  10. $statement->store_result();
  11. $statement->bind_result($nombre, $telefono, $direccion, $localidad, $provincia, $categoria );
  12. //$count=$statement->num_rows;
  13. $html= "<h1>$categoria</h1>
  14. <table class='zona'>
  15. <thead>
  16. <tr>
  17. <th>Provincia</th>
  18. <th>Localidad</th>
  19. <th>Distribuidor</th>
  20. <th>Domicilio</th>
  21. <th>Teléfono</th>
  22. </tr>
  23. </thead>
  24. <tbody>";
  25. echo $html;
  26. while ( $statement->fetch() ) {
  27. echo "
  28. <tr>
  29. <td>$provincia</td>
  30. <td>$localidad</td>
  31. <td>$nombre</td>
  32. <td>$direccion</td>
  33. <td>$telefono</td>
  34. </tr>";
  35. }
  36. echo "</tbody></table>";
  37. ?>
  38. aca termina mi div