PostgreSQL is LoveTech's database of choice for most of our deployments due to its world class excellence and unbeatable price tag(FREE!).
We've built a convenience library in PHP for common database operations and are documenting it here and releasing it to the public for free.
Pay it forward, our friends
$db = new Database($psqlHost, $psqlPort, $psqlDatabase, $psqlUser, $psqlPwd);
echo json_encode($db->GetTableList());
$db->close();
file_downloadPostgreSQL PHP Library
Initializes the PostgreSQL connection. Called automatically by constructor
Used to close the PostgreSQL connection when finished with querying
Gets a single result from a database query
Gets a single result from a database query
Gets all results from a database query
Gets a single result from a database query with nested sub-objects embedded
Gets all results from a with embedded noded. For example, client_id field can spawn client node with title
Upserts a single object/ document
Inserts a single object/ document
Updates all object/ document that match the constraint
Upserts a series of objects/ document
Upserts a nested object/ document
Upserts multiple nested objects/ documents
Runs a PostgreSQL query directly against the database. Ideal for CREATE or ALTER TABLES, UPDATE, or INSERT statements
Runs a PostgreSQL query directly against the database using the $1, $2, etc placeholder notation and query params array, $params. Ideal for UPDATE, or INSERT statements with escaping special characters
Check if the objects/ documents are associated as specified
Get all of the associations in accordance with the provided rules
Ensures that the specified associations exist. If $exhaustive is passed as true, all non referenced associations will be removed
Removes the associations specified in $associationsToDelete
Removes the associations specified using the remove rules
Gets a list of all tables in the connected to database
Gets the column definitions of the table
Gets the column definitions of all tables in the connected to database
After data is fetched from the database, this function aligns all of the variable types to match the field definitions
Used to dynamically generate PostgreSQL SELECT query field lists
Used to dynamically generate PostgreSQL SELECT and UPDATE query WHERE clauses
Used to determine if two or more tables are involved in the query
Used to determine if the table exists
Returns the name of the database that the PHP5 PostgreSQL driver is currently connected to
Checks if a PostgreSQL database with this name exists