| 123456789101112131415161718192021222324252627282930313233 |
- <?php
- include('db.php');
- if (!$statement = $db->prepare("SELECT p.presentacion, p.nombre, d.descripcion, f.formula, pri.principio
- FROM productos p
- left join descripcion d
- on p.idproducto = d.idproducto
- left join principios pri
- on p.idproducto = pri.idprincipios
- left join formulas f
- on p.idproducto = f.idproducto
- where p.idproducto = ?")) { die('Error');}
- if (isset($_GET['id'])) { $id = $_GET['id']; } else { die('sin id');}
- $statement->bind_param('d', $id);
- $statement->execute();
- $statement->store_result();
- $statement->bind_result($presentacion, $nombre, $descripcion, $formula, $principio);
- if (!$statement->fetch()) { die('why'); }
- $html = " <div id = 'texto'>
- <h5>$nombre</h5><br/><br/>
- <h5>Descripción</h5><br/>
- $descripcion<br/><br/>
- <h5>Formula</h5><br/>
- $formula<br/><br/>
- <h5>Principios</h5><br/>
- $principio<br/><br/>
- <h5>Presentación</h5><br/>
- $presentacion<br/><br/>
- </div>";
- echo $html;
- ?>
|