Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Connection Information
- $db_host = 'localhost';
- $db_database = 'tdb';
- $db_username = 'root';
- $db_password = 'root';
- $db_port = '8889';
- $conn = new mysqli($db_host , $db_username , $db_password , $db_database , $db_port);
- // Connection Check
- if ($conn->connect_errno > 0) {
- die('Unable to connect to database [' . $conn->connect_error . ']');
- }
- // Add Arabic Charsets
- date_default_timezone_set('UTC'); // change server zone to UTC
- $conn->set_charset("utf8"); // change collation to UTF-8
- // DB selection from SQL
- $sql = "SELECT * FROM circulars";
- if (!$result = $conn->query($sql)) {
- die('There was an error running the query [' . $conn->error . ']');
- }
- // Fetch Data from SQL to table
- while($row = mysqli_fetch_assoc($result)){
- echo "<tr><td>" . $row["id"] . "</td><td>" . $row["titlet"] . "</td><td>" . $row["publicationDate"] . "</td><td><a href=".$row["view"].">View</a></td></tr>";
- }
- echo "</table>";
Add Comment
Please, Sign In to add comment