Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Práctica</title>
- </head>
- <body>
- <?php
- $servername = "localhost";
- $username = "root";
- $password = "root";
- // Create connection
- $conn = new mysqli($servername, $username, $password);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- ?>
- <h1>Marcas</h1>
- <table border="1">
- <thead>
- <tr><th>Id<th>Nombre
- </thead>
- <tbody>
- <? $result = $conn->query("select * from marcas");
- if($result->num_rows>0)
- while($row=$result->fetch_assoc()){
- ?>
- <tr><td><?echo $row["id"];?> <td><? echo $row["nombre"]; ?>
- <?}?>
- </tbody>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement