Commit 76d523a0 by Andry F. Hutapea

perubahan

parent 7c50f840
<?php
$host="localhost"; // Host name
$username="root"; // Mysql username
$password=""; // Mysql password
$db_name="tbc"; // Database name
$tbl_name="fpengumuman"; // Table name
// Connect to server and select databse.
$conn = mysqli_connect("$host", "$username", "$password")or die("cannot connect");
mysqli_select_db($conn,"$db_name")or die("cannot select DB");
$sql="SELECT * FROM $tbl_name ORDER BY id DESC";
// OREDER BY id DESC is order result by descending
$result=mysqli_query($conn,$sql);
$no=0;
?>
<table width="30%" border="2" align="left" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<img src="foto/IMG_20170311_103634.jpg">
</tr>
</table>
<table width="70%" border="0" align="right" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td width="10%" align="center" bgcolor="#E6E6E6"><strong>No</strong></td>
<td width="53%" align="center" bgcolor="#E6E6E6"><strong>Topic Pengumuman</strong></td>
<td width="13%" align="center" bgcolor="#E6E6E6"><strong>Date/Time</strong></td>
</tr>
<?php
// Start looping table row
while($rows = mysqli_fetch_array($result)){
?>
<tr>
<td align="center" bgcolor="#FFFFFF"><?php echo ++$no;; ?></td>
<td align="center"bgcolor="#FFFFFF"><a href="view_pengumuman.php?id=<?php echo $rows['id']; ?>"><?php echo $rows['topic']; ?></a><BR></td>
<td align="center" bgcolor="#FFFFFF"><?php echo $rows['datetime']; ?></td>
</tr>
<?php
// Exit looping and close connection
}
//mysql_close();
?>
</table>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment