Skip to content

Commit

Permalink
internal commit
Browse files Browse the repository at this point in the history
  • Loading branch information
indianmodassir committed Nov 17, 2024
1 parent 4560e9d commit d9a487d
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 8 deletions.
8 changes: 4 additions & 4 deletions .env
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
DB_CONNECTION=mysql
DB_HOST=sql212.infinityfree.com
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=if0_37273804_asot
DB_USERNAME=if0_37273804
DB_PASSWORD=Bo8H7dFQTF5Ix
DB_DATABASE=afsuweb
DB_USERNAME=root
DB_PASSWORD=
32 changes: 32 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "modassir/afsuweb",
"description": "Test class 12th ARTS objective question and result system, and provide answer key.",
"type": "project",
"license": "MIT",
"keywords": ["asot", "afsuweb", "moc-test"],
"homepage": "https://github.com/shahzadamodassir",
"require": {},
"require-dev": {},
"authors": [
{
"name": "Shahzada Modassir",
"email": "[email protected]",
"homepage": "https://github.com/shahzadamodassir"
}
],
"funding": [
{
"type": "Github",
"url": "https://github.com/shahzadamodassir"
},
{
"type": "Patreon",
"url": "https://patreon.com/shahzadamodassir"
},
{
"type": "Opencollective",
"url": "https://opencollective.com/shahzadamodassir"
}
],
"minimum-stability": "stable"
}
12 changes: 8 additions & 4 deletions connection/dbconnect.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@

declare(strict_types=1);

require $_SERVER["DOCUMENT_ROOT"].'/vendor/autoload.php';
\Pointenv\Pointenv::quickLoad();
use Dotenv\Dotenv;

$DSN = sprintf("%s:host=%s;dbname=%s;", "mysql", "sql212.infinityfree.com", "if0_37273804_asot");
require __DIR__.'/../vendor/autoload.php';

Dotenv::process(__DIR__, ['../.env', '.env'])->safeLoad();


$DSN = sprintf("%s:host=%s;dbname=%s;", $_ENV['DB_CONNECTION'], $_ENV['DB_HOST'], $_ENV['DB_DATABASE']);

try {
$conn = new \PDO($DSN, "if0_37273804", "Bo8H7dFQTF5Ix");
$conn = new \PDO($DSN, $_ENV['DB_USERNAME'], $_ENV['DB_PASSWORD']);
} catch(PDOException $e)
{
die("Database not connected!");
Expand Down

0 comments on commit d9a487d

Please sign in to comment.