Connecting to SteemSQL database using PHP7

Github project:
https://github.com/Bulletproofmonk/PHPSteemSQL

File edited for this commit:
PHP7 sample code for connecting to SteemSQL
Readme file

Links to each commit:
Added SteemSQL connection code for PHP7
Edit Readme

The PHPSteemSQL project on Github contains code samples for querying the SteemSQL database using PHP. PHP programmers who are not familiar with the Microsoft SQL database which SteemSQL is based on may have trouble connecting to the database using the PHP extensions without a reference point. The purpose of this project is to provide PHP programmers with sample codes to help them connect and query the SteemSQL database.

Previously, I have provided the PHP5 code for connecting and querying the database in this article. In this development update, I have added the code for connecting to SteemSQL using PHP7, as well as updated the Readme.md file to reflect this change.

The main differences between the connection files for PHP5 and PHP7 are summed up in the table below:

DifferencePHP5PHP7
Extension required mssql pdo_dblib
Syntax used Procedural Object Oriented

The new extension used in PHP7 called PDO_DBLIB enables access to Microsoft SQL Server databases via PHP using the PHP Data Objects (PDO) interface. The mssql extension used in PHP5 is no longer available for PHP7.

Make sure you enable the required extensions for the relevant PHP version in order for it to work (see PHP5 article for instructions on how to enable PHP extensions with web hosts that use the CPanel interface and how I managed to unblock outgoing connections to a specific port).

Screenshot of logged in session of Github to prove I'm the owner:

image.png



Posted on Utopian.io - Rewarding Open Source Contributors

H2
H3
H4
3 columns
2 columns
1 column
9 Comments