How to get external data from MS SQL from Wordpress Blog?

In Wordpress, how can I extract data from an external Microsoft SQL database for display as a read-only table?

To be clear, this is not a question of how to convert Wordpress to MS SQL, but rather how to extract data for a specific widget from a source outside the main Wordpress DB. The data I need to retrieve is in the MS SQL database.

For example, suppose I need to pull out stores and watches:

/* Retrieve store locations from the external MS SQL database*/

SELECT id, name, address, city, state, zip, phone, openingTime, closingTime
FROM locations
ORDER BY name

And display this data in a table on a Wordpress page:

<table>
<tr>
    <th>Store Name</th>
    <th>Address</th>
    <th>Store Hours</th>
</tr>

<!-- Display rows of store locations here -->

</table>
+5
source share
1 answer

Wordpress PHP, PHP- SQL Server. . SQL Server PHP.

Wordpress Linux, FreeTDS, . PHP mssql.

+3

All Articles