$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>Options on how to Display member specific data from a MS SQL database|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

Options on how to Display member specific data from a MS SQL database

matteradmin9PV0评论

I am in the conceptual stage still but I want to create a word press database that will do the following in the following scenario:

Lets say i have 10 sales people in my store. I want them to be able to: -log into my WordPress site (loginID and password) -once they log in, i want for my website to fetch all the sales they have in my Microsoft SQL database (that I already have) and be displayed for them. (only the sales that belong to them) also display them in an easy to read table.

Can you guys point me in the right direction with this? every time i search wordpress and SQL its always about the SQL database and not on how to reach an external database and display info from that external database. Thanks!

I am in the conceptual stage still but I want to create a word press database that will do the following in the following scenario:

Lets say i have 10 sales people in my store. I want them to be able to: -log into my WordPress site (loginID and password) -once they log in, i want for my website to fetch all the sales they have in my Microsoft SQL database (that I already have) and be displayed for them. (only the sales that belong to them) also display them in an easy to read table.

Can you guys point me in the right direction with this? every time i search wordpress and SQL its always about the SQL database and not on how to reach an external database and display info from that external database. Thanks!

Share Improve this question asked Feb 21, 2019 at 23:03 MexusaMexusa 11 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 1

You can create a new wpdb object and connect to an external MySQL database, though there will be a performance cost to making a remote connection, don't expect it to be fast.

But, you mentioned it's an MS SQL database, not MySQL. There won't be a WordPress based mechanism to do this, you'll have to look for generic PHP solutions

You would need to use the Microsoft PHP SQL Drivers to connect to the database, (https://blogs.msdn.microsoft/sqlphp/) but keep in mind you will have to write all the code, all the UI, everything, from scratch. There is nothing in WordPress that will be of help. This is assuming your MSSQL database can be accessed remotely, most database servers are not configured this way for security reasons.

Any questions about using MSSQL in PHP would need to go on StackOverflow as they wouldn't be WordPress questions, and finding anybody who uses WordPress and MSSQL would be extremely difficult/rare.

It would be much easier to make requests to a remote API that talked to the MSSQL database, but you would have to build and maintain that API yourself.

Post a comment

comment list (0)

  1. No comments so far