Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>WebTest</title>
- <style type="text/css">
- </style>
- </head>
- <body>
- <form action="test.php" method="POST">
- <label>
- Registracijas numurs<input type="text" name="Registracijas_numurs" value="">
- </label></br>
- <label>
- Izlaiduma gads<input type="text" name="Izlaiduma_gads" value="">
- </label></br>
- <!-- <label>
- Marka<input type="text" name="Marka" value="">
- </label></br>
- <label>
- Motora tips<input type="text" name="Motora_tips" value="">
- </label></br> -->
- <label>
- Motora tilpums<input type="text" name="Motora_tilpums" value="">
- </label></br>
- <label>
- Pilna masa<input type="text" name="Pilna_masa" value="">
- </label></br>
- <label>
- Pasmasa<input type="text" name="Pasmasa" value="">
- </label></br>
- <!-- <label>
- Piedzinas tips<input type="text" name="Piedzinas_tips" value="">
- </label> -->
- <input type="submit" value="Ievadit">
- </form>
- <?php
- $db_hostname = "localhost";
- $db_database = "prak";
- $db_username = "root";
- $db_password = "123";
- $conn = mysqli_connect($db_hostname, $db_username, $db_password, $db_database);
- if ($conn -> connect_error) {
- die ("Connection failed" . $conn -> connect_error);
- }
- echo "<h3>Connected</h3>" . "<br>";
- //Display table data
- $sql = "SELECT AUTONR, AUTOGADS,
- MOTORATILPUMS, PILNAMASA, PASMASA, NOSAUKUMS FROM auto, marka";
- $result = mysqli_query($conn, $sql);
- echo "<table border=1>
- <tr>
- <th>Reģistrācijas numurs</th>
- <th>Izlaidumagads</th>
- <th>Marka</th>
- <th>Motora tips</th>
- <th>Motora tilpums</th>
- <th>Pilnā masa(kg)</th>
- <th>Pašmasa(kg)</th>
- <th>Piedziņas tips</th>";
- if ($result = mysqli_query($conn, $sql)) {
- while ($row = mysqli_fetch_row($result)) {
- echo "<tr>";
- echo "<td>" . $row['0'] . "</td>";
- echo "<td>" . $row['1'] . "</td>";
- echo "<td>" . $row['5'] . "</td>";
- echo "<td>" . "-" . "</td>";
- echo "<td>" . $row['2'] . "</td>";
- echo "<td>" . $row['3'] . "</td>";
- echo "<td>" . $row['4'] . "</td>";
- echo "<td>" . "-" . "</td>";
- echo "</tr>";
- }
- }
- echo "</table>";
- //close connection
- mysqli_close($conn);
- ?>
- </body>
- <html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement