如何从SQL服务器获取动态链接以提取数据

如何从SQL服务器获取动态链接以提取数据

本文介绍了如何从SQL服务器获取动态链接以提取数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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. 





我的尝试:





What I have tried:

<?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>

推荐答案




这篇关于如何从SQL服务器获取动态链接以提取数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-22 03:00