<?php $debug = true; function dbPDOConnect($dsn, $dbName){ global $db, $debug; $db_usernameAdmin = *********; $db_passwordAdmin = **********; if (!$db) $db = new PDO($dsn . $dbName, $db_usernameAdmin, $db_passwordAdmin); if (!$db) { return 0; } else { return $db; } } function connectPDO($dsn,$dbName){ global $debug; $query = NULL; try { $db=dbPDOConnect($dsn, $dbName); if($debug) print '<p>You are connected to the database!</p>'; } catch (PDOException $e) { $error_message = $e->getMessage(); if($debug) print "<p>An error occurred while connecting to the database: $error_message </p>"; } } connectPDO('mysql:host=webdb.uvm.edu;dbname=','LTOPPER_CS148_Final'); ?>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)