Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Constant global variables. All stored here for ease.
- // database values
- define("db_host","host=127.0.0.1");
- define("db_Port","port=5432");
- define("db_Name","dbname=accounting1");
- define("db_Credentials","user=websqluser password=Lollipop123");
- //--------------------------------------------------------
- ?>
- <?php
- include "inc/globalValues.php";
- class sqlHelper
- {
- // On creation of this class, it will open a connetion to the database with the credentials provided in
- // inc/globalConsts.php file
- public function __construct()
- {
- $db = pg_connect('$db_Host $db_Port $db_Name $db_Credentials');
- if (!$db)
- {
- echo "Error: Unable to open the db bleh";
- }
- else
- {
- echo "Yeah, shits working, go you.";
- }
- }
- }
- $obj = new sqlHelper;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement