Created
February 3, 2019 14:28
-
-
Save griajobag/18ea04768c46901afe0db4f9022dbbf5 to your computer and use it in GitHub Desktop.
Pagination php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Connection{ | |
function getConnection(){ | |
$host = "localhost"; | |
$username = "root"; | |
$password = ""; | |
$dbname = "pagination"; | |
try{ | |
$conn = new PDO("mysql:host=$host;dbname=$dbname", $username, $password); | |
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); | |
return $conn; | |
}catch(PDOException $ex){ | |
echo "Error koneksi ke database : " . $ex.getMessage(); | |
} | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment