Skip to content

Instantly share code, notes, and snippets.

@ErMandeep
Last active February 1, 2019 04:38
Show Gist options
  • Save ErMandeep/0d885ff29de1f42fe23fa244f62dfc16 to your computer and use it in GitHub Desktop.
Save ErMandeep/0d885ff29de1f42fe23fa244f62dfc16 to your computer and use it in GitHub Desktop.
db connection on server
<?php
$db['db_host'] = "localhost:3306";
$db['db_user'] = "enterusername";
$db['db_pass'] = "enterpass";
$db['db_name'] = "dbname";
foreach ($db as $key => $values ){
define(strtoupper($key), $values);
}
$connection = mysqli_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
$connect = new PDO("mysql:host=localhost:3306;dbname=enterdbname", "enterusername", "enterpass");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment