Skip to content

Instantly share code, notes, and snippets.

@griajobag
Created February 3, 2019 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save griajobag/18ea04768c46901afe0db4f9022dbbf5 to your computer and use it in GitHub Desktop.
Save griajobag/18ea04768c46901afe0db4f9022dbbf5 to your computer and use it in GitHub Desktop.
Pagination php
<?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