data.php :
<?php
$ch = curl_init('example.com/');
// set curl option to fetch (get)
$result = curl_exec($ch);
echo $result;
$conn = new mysqli('localhost', 'root', '', 'shoutout');
if ($conn->connect_error) {
die("Connection error: " . $conn->connect_error);
}
$result = $conn->query("SELECT channel1 FROM users");
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
echo $row['channel1']. '<br>';
}
}
?>
index.php :
<?php
include('data.php')
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
</head>
<body>
<iframe id="w2" src="data.php" height="80px" width="300px" frameborder="0" style="border: 0; width:300px; height:80px; background-color: #FFF;"></iframe>
</body>
</html>
i made some changes ,, i can retrive values but it is not appending , please help.
i want to make url by using variable and database value . and want to load in iframe.
thank you