connect_error) { die("Connection failed: " . $conn->connect_error); } $sql = "SELECT scrip_name, opening_price, closing_price FROM input"; $result = $conn->query($sql); if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { echo "
id: ". $row["scrip_name"]. " - Name: ". $row["opening_price"]. " " . $row["closing_price"] . "
"; } } else { echo "0 results"; } $conn->close(); ?>