I'm trying to connect a web portal coded in PHP to a Sharepoint database. I researched and there are 2 possible options to use: MSSQL 2005 OBDC Driver and Webservices.
Which of this 2 options is the better one, and why?
https://technet.microsoft.com/en-us/library/cc793139(v=sql.90).aspx
This is an easy answer. The answer is the web services because directly querying SharePoint's databases is not allowed from a supportability standpoint (reference: https://blogs.msdn.microsoft.com/brian_farnhill/2013/12/04/directly-querying-sharepoint-databases/)
To summarize some of the core arguments is that directly talking to the database (even if it is just reads) introduces unpredictable locking of database resources which will cause problems. On top of this, the Content Database schema is not the best of my knowledge formally documented and of course subject to frequent changes. If you've ever peered inside you'll see that it is quite complicated and thus difficult to come up with generic SQL to get the data you want. The API (and therefore the web services) have done the hard work to give you a generic interface into SharePoint and to hide the complexity.
Lastly, if you are at all thinking about modifying SharePoint you are an absolute glutton for pain if you think about using direct SQL.
Related
Problem:
I am building a RESTful API. The DBA I'm working with has set up an MSI for gaining access to the production database, which is on an Azure SQL instance. I understand that MSI's are token based, and on https://learn.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/tutorial-windows-vm-access-sql, it has an example written in C#. This does not translate to PHP well, mostly because of my unfamiliarity with C#.
In addition, I am using Lumen to develop the API, which uses PDO for handling the connections. As far as I know, PDO does not have the necessary functionality built in to handle the specialized connection string Azure SQL requires for using an MSI. See Azure Sql Db connection string when using MSI
Previous research:
I've read just about every article Microsoft has published about managed identities, and scoured the internet for anyone using managed identities in PHP. Needless to say, the pickings are slim, even more so for this particular use case.
I understand that one could use Key Vault and store the connection string as a note, but I'm 99% sure the system admins won't want this to happen. What's the point in having the MSI if we're still going to have credentials stored somewhere else?
Worst case, I suppose I could make the proposition that I need to use a traditional user/password auth flow, despite the powers that be wanting all new projects to use MSIs (we're predominantly a Microsoft shop with a small portion of PHP work).
Posting this is my last ditch effort before presenting my proposition to use Key Vault instead for, at very least, storing the production credentials; the idea of storing a connection string is an anti-pattern in my opinion.
Fundamentally, if someone could provide an example PDO connection string (sqlsrv driver) using an MSI, it would probably move me in the right direction. Any other examples one could provide, or even guidance for how I can use the MSI in this context would be greatly appreciated.
Per https://learn.microsoft.com/en-us/sql/connect/php/azure-active-directory?view=sql-server-ver15, PDO does have the required functionality. Answering this as the scope of the original question has shifted too far from its original focus.
I now have a support question opened at https://github.com/laravel/framework/discussions/33678 to determine the best method of utilizing an MSI in Laravel as there is no apparent way to do so based on the code/documentation.
I am currently developping my own CMS using PHP/SQL on the server side and Javascript on the client side.
A previous version of it was pure Javascript but I realised that this was making my website unaccessible to no-script users.
I therefore shifted my paradigm to a server building a basic version and javascript providing eyecandy options.
The data are in a SQL database accessed using PDO.
Some co-workers wanted to use my CMS but they are not used to MySQL and dont like to have to migrate their databases when migrating their website (which, for many reasons, can happen quite often).
I thought of using SQLite as the database would be a simple file that could be moved easiely. However SQLite is not available in our institution professional web pages service.
I understand that using a php based impementation would limit the capabilities of load balancing (which you have when physically separating the webserver and the database) but my database would stay very small and shouldn't cause performances issues.
Question:
Is there any php impementation of SQLite that would work even when sqlite and pdsqlite modules are not available ?
Is there any other solution to have PDO fallback to a basic file-based database that could be migrated easielly ?
Try the pdo odbc adapter often this can be used.
If sqllite is not available why not go back to flatfliles especially if the data amount is not to big write json files or xml files these can be queried quiet easily especially the json files further they are easily ported.
I have a database in Access I need to access a Microsoft Access database via the internet and am building a PHP interface. I would like to know if it would be better to convert to MySQL or Microsoft CRM Dynamics as would they be faster?
My other question is can MS Access or MS Dynamics even be accessed via PHP PDO currently? If not my first questions is redundant and MySQL is the way to go.
Regards,
Max
Short answer:
it certainly makes sense to migrate your data into a normal relational database system, regardless if that is MariaDB, MySQL, PostgreSQL or whatever. Many advantages exist besides performance, for example you get rid of the vendor lock in and have free access to your data the way you want to. This includes using php to access that data. Is there any reason against migrating it? I mean reasons expect "we always used MS-Access" or the like...
And I never heard of a reliable and stable MS-Access driver for PHP.
Hi all i am a Student working on a project in an Hospital we designed an application where patient can book an appointment with doctor similar to this application (apphp.com/php-medical-appointment/examples/sample2/index.php) and our application uses php and mysql and runs on microcms framework now what we are trying to do is to get this application integrated with MedTrak (http://www.intersystems.com/trakcare/) which uses CACHE DB (Intersystems Cache db a post relational db)
we have written our application using mysql so is there any possible ways that we can fire data from our application to their db and. get, data from their db
So far we have tried these methods
odbc will it work cause we have to write our application in ODBC again
Help
Enterprise Application Patterns is a great book and I highly recommend it. However, I would add that even if you had top notch messaging middle-ware available to ensure the 2 applications are as loosely coupled as possible, at some point you will have to read or write to the Cache database, and you will probably need both.
Also, a sophisticated approach to integration may or may not be feasible on a student project. Perhaps it would be sufficient to have most of your code talk to an abstract communication layer that encapsulates the exact integration? You could start with whatever is simplest to implement but could have a story about how it could be changed later. Even this is probably quite hard enough for a student project, since the interface really should assume the communication is asynchronous.
In any case, at some point the rubber will meet the road and you will have to read and/or write to the Cache database. And at that point, ODBC is available, and sounds like it would be a good choice for you. There are other methods to connect to Cache but ODBC is widely used (and therefore probably more reliable) and doesn't require you to learn Cache Object Script, which would be a lot of extra work for your situation.
There are many ways to achieve this - the best way to learn about this is to read "Enterprise Integration Patterns".
I wouldn't recommend writing directly to each other's database - it is a fragile way of gluing apps together, because a change in one schema requires you to change the other app at the exact same time. You have to deal with exotic failure modes - one database may be down for backups, which means you can't write the changes from the other database to it.
Read the book for alternatives!
I find myself in a situation that someone else must have got stuck in at some point.
Our company runs an in house MSSQL based database, our website then sits on an external server and currently runs MySQL. The problem comes that both databases need to communicate with each other increasingly often.
Our current solution involves SSIS packages but they are tempromental and often slow. We end up very often having to drop tables on our live production server before then rebuilding them from the in house server. Of course this is leading to data inconsistencies so we try and perform these operations outside of peak hours. However, this leads to 24hr delays in some data being transferred from MySQL to MSSQL and then an additional 24hr delay in getting it back to MySQL. None of this is ideal.
What I am looking for is a solution that will allow replication between our in-house MSSQL server and any database that can sit upon a linux box and play nicely with PHP. As I said, we currently run MySQL so we have a preference to any solution that would include that but all other suggestions would be greatfully received.
I've read somewhere that PostgreSQL is a vialbe solution but I am now struggling to find where I read that. I've come accross a few tools that might help such as DBMoto and Slony-I, does anyone have any experience of either in such a situation?
Alternatively, are we simply barking up the wrong tree altogether and should we be trying to integrate MSSQL into our PHP environment?
Any thoughts or suggestions would be gratefully recieved.
Many thanks
Rob
The best solution that i know and i have used for this kind of job is SymmetricDS .
SymmetricDS is an asynchronous data replication software package that
supports multiple subscribers and bi-directional synchronization.
You can access MSSQL servers from PHP using FreeTDS and the mssql_* family of functions (or classes built thereon, or alternative freetds-using extensions). We use this for our admin application, with a Linux/PHP website talking to a MSSQL database.