Last active
April 14, 2021 18:29
-
-
Save andriyun/eb7fe7b3b5c398ffb469703b553550f1 to your computer and use it in GitHub Desktop.
PHP db connection with PDO
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 | |
$DB = new PDO("mysql:host=db_host;dbname=db_name", "db_user", "db_user_pass"); | |
$statement = $DB->prepare("SHOW TABLES;"); | |
$statement->execute(); | |
print_r($statement->fetchAll()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment