Как я могу получить динамические ссылки для извлечения данных из SQL server?
Hello! I am not getting any errors but when I run my code it doesn't pull anything from the server. It is just blank. I feel like there must be something really obvious I'm missing.
Что я уже пробовал:
<?php if(isset($_GET['id'])) { require_once 'login1.php'; $id = null; $conn = new mysqli($hn, $un, $pw, $db); if($conn->connect_error) die($conn->connect_error); $ID = mysqli_real_escape_string($conn, $_GET['id']); $sql = "SELECT * FROM freshwater WHERE id='$id' "; $result = mysqli_query($conn, $sql) or die("Bad Query: $sql"); $row = mysqli_fetch_array($result); } else { header('Location: freshwaterlist.php'); } ?> <html> <head> <title>Fish R Us - Saltwater Fish</title> </head> <body> <div class="toptext"><center> <img src="banner.png" height="300"></img></center> </div> <center> <h2><?php echo $row["name"] ?></h2> <img src="<?php echo $row["picture"] ?>"></img> <table> <tr> <th>Name</th> <th>Type</th> <th>Quantity</th> <th>Price</th> </tr> <tr> <td><?php echo $row["name"] ?></td> <td><?php echo $row["type"] ?></td> <td><?php echo $row["qty"] ?></td> <td><?php echo $row["price"] ?></td> </tr> </table><br> <table class="fish-text"> <th><?php echo $row["description"] ?></th> </center></table><br> <button padding: 10px 24px;><a href="products.php">Return to Products List</a></button></body> <button padding: 10px 24px;><a href="menu.php">Return to Menu</a></button> </html>