Embed presentation
Download to read offline

![// Uji Sambungan
if ($conn->connect_error) {
die("Connectionfailed:". $conn->connect_error);
}
$sql = "SELECT id_pelajar,nama_pelajar,notel_pelajarFROMtb_pelajar";
$result= $conn->query($sql);
if ($result->num_rows>0) {
// Outputdata setiapbaris
while($row =$result->fetch_assoc()) {
echo"<tr><td>" . $row["id_pelajar"]."</td><td>". $row["nama_pelajar"] ."</td><td>"
. $row["notel_pelajar"]."</td></tr>";
}
echo"</table>";
} else { echo"0 results";}
$conn->close();
?>
</table>
</body>
</html>](https://image.slidesharecdn.com/tict13codingphp-200331064743/85/TICT-13-2-320.jpg)
This document contains a PHP script that connects to a database called "db_sambungan" and extracts student data including their ID, name, and phone number from a table called "tb_pelajar". It displays the extracted data in an HTML table with styling. The script connects to the database, selects the student data from the table, then outputs each student's record into a new table row.

![// Uji Sambungan
if ($conn->connect_error) {
die("Connectionfailed:". $conn->connect_error);
}
$sql = "SELECT id_pelajar,nama_pelajar,notel_pelajarFROMtb_pelajar";
$result= $conn->query($sql);
if ($result->num_rows>0) {
// Outputdata setiapbaris
while($row =$result->fetch_assoc()) {
echo"<tr><td>" . $row["id_pelajar"]."</td><td>". $row["nama_pelajar"] ."</td><td>"
. $row["notel_pelajar"]."</td></tr>";
}
echo"</table>";
} else { echo"0 results";}
$conn->close();
?>
</table>
</body>
</html>](https://image.slidesharecdn.com/tict13codingphp-200331064743/85/TICT-13-2-320.jpg)