Is it possible to import Quickbooks Desktop data directly to a live online mysql database using PHP ?
Directly? No. QuickBooks isn't based on an SQL database of any sort -- it's a proprietary data format, and you can only communicate with it via XML.
The closest you can get is either:
- Something like QODBC, which lets you query QuickBooks via a SQL-to-XML translation engine.
OR
- Something that does XML queries against QuickBooks to try to mirror data from QuickBooks into an SQL database (e.g. something like https://github.com/consolibyte/quickbooks-php which is what you're example $dsn string indicates you're using).
So my question is instead of using localhost can I use Live server's credentials in order to import data ?
Um, what? Your questions kind of don't make a whole lot of sense, but...
You can use any database you want. It doesn't have to live on localhost
. Just change the $dsn
to where ever your database lives.
Or else do I first need to import desktop version's data into Quickbooks online version in order to achieve this ?
QuickBooks Online is a completely separate product, that has absolutely nothing at all to do with QuickBooks for Windows. It's a completely separate product, with a separate API, a separate back-end data structure, developed by a separate team of developers, on a separate platform, in a separate programming language, etc. The two share absolutely nothing in common outside of being developed by the same company. And neither will give you direct SQL access to the data.