Will I be able to connect to this database using PHP's php_mongo.dll driver?
If so, could you please provide some sample code?
MongoDB requires its own driver.
In your case, the PHP driver is located here:
http://php.net/manual/en/book.mongo.php
The instructions for installing it are on that page. There is also some sample code.
I think that PDO is only for relational databases. There's no PDO driver for MongoDB.
There is list of databases which you can use with the PDO driver: http://php.net/manual/en/pdo.drivers.php. MongoDB is not among them.
You can use the PHP PDO OBDC library, if you install MongoDB BI Connector and MongoDB ODBC Driver for BI Connector.
I haven’t tried it, but I’m about to - keep you posted.
https://www.mongodb.com/download-center/bi-connector
https://docs.mongodb.com/bi-connector/master/reference/odbc-driver/
Related
I am using Laravel 5 and want to connect to a Azure Data warehouse using the implemented PDO database connection Laravel provides. I am using the following connection settings.
DB_CONNECTION=sqlsrv
DB_HOST=tcp:srv.url.com,1433
DB_DATABASE=db-name
DB_USERNAME=user
DB_PASSWORD=pass
When I load the page I get a "could not find driver" error.
How is this possible? The drivers are build into Laravel rigth?
Thanks in advance!
You need to install the PDO driver for sqlsrv manually, configure in PHP PDO_SQLSRV extension enabled by adding appropriate DLL file like php_pdo_sqlsrv_53_nts.dll, and which is only compatible with PHP running on Windows. You can refer to http://php.net/manual/en/ref.pdo-sqlsrv.php for more info.
To connect to SQL server in PHP in Unix, you can use ODBC extension and Microsoft's SQL Server ODBC Driver for Linux.
as everybody knows, Firebird is again added to official build of PHP, and has it's own PDO extension. I thought about connecting it with Doctrine2. Officialy, website of Doctrine2 project says that they don't support Firebird yet. But now it has own PDO extension, so maybe there is a way to use it?
Does anybody tried to connect Doctrine2 with PDO Firebird?
There are some open issues for the Doctrine DBAL extension for Firebird: http://www.doctrine-project.org/jira/browse/DBAL-95
I have been searching mssql driver for Laravel framework, but had no luck so far. I know Laravel has sqlsrv support for sql servers, but what I need is mssql connector (ones that have functions starting with 'mssql_').
We cannot use sqlsrv because most of our servers are MSSQL 2000, and sqlsrv doesn't provide support for these servers as far as I know. Also, MS does not provide sqlsrv driver for linux. (We are using freetds driver with manually compiled php 5.4.8 on Fedora 17 64-bit).
My question is
Is there any patch for mssql support in Laravel?
If not, which files should I create/modify to have mssql supported if it is ever possible?
I could use different framework that supports mssql as well, but I really like how Laravel handles everything. I didn't want to give up on Laravel just because it doesn't support mssql.
It seems it does not include that driver... I believe you can setup it at laravel/database/connectors
We need to access a Teradata database via php application We don't have odbc (unixodbc etc) on the server.
How might one go about connecting to a teradata database quickly.
Keep in mind - this app needs to be as portable as possible.
Teradata provides an ODBC driver. Once installed, it can be accessed via the unixODBC driver manager, assuming your php was built with "--with-unixODBC=shared,/usr".
PHP can then connect to a Teradata database with odbc_connect($dsn, $user, $passwd);
The Teradata ODBC driver installation includes a sample odbc.ini file, which you can cp to .odbc.ini in your home directory, then modify to contain the DSN for your Teradata database.
Set the environment variable ODBCINI to the location of your odbc.ini file to use (/home/johndoe/.odbc.ini is common).
Be warned: the Teradata ODBC driver provides a rich set of DML statements, but very few are exposed through the unixODBC driver manager. The collection of PHP's odbc_xxxx() functions is a crippled subset of what the Teradata ODBC driver offers.
This method would help you if u are ok with the memory implications and this would help you if you have teradata command line utility BTEQ installed on your machine.
But better method would be by ODBC as it gives you the flexibility. In the above method of command line execution of SQL scripts by system() function, you can use an easier language like R for parsing the output resultset.
I think you may also do it by jdbc connection. You can also download any of these odbc/jdbc drivers from this link.
You may be out of luck.
PDO doesn't have a native driver
ADODb doesn't have a native driver
judging from what I find from a cursory web search, I'd say it is not possible to connect from PHP to a Teradata database without ODBC.
I have been looking around the current options (and related SO questions) regarding PHP ORM solutions, however I have a couple of unique requirements:
I am running PHP on Windows Server 2003
I need to interface with SQL Server 2005
I can't seem to find a simple answer from the PHP ORM solutions out there as to which (if any) support MSSQL as an adaptor option. Outlet seems to support this, for instance, but is only mentioned in passing on the documentation page, while other references say that the current version (1.0) has only been tested with MySQL.
At the moment, I am using the Microsoft PHP SQL Server driver, which as I understand it, can't be used with current ORM solutions until the driver itself supports PDO (which the team are looking into, but with no timeframe).
So what can I use today as an ORM solution on PHP for Windows that interfaces with SQL Server. Anything out there at all?
From Doctrine manual:
The currently supported PDO database drivers are:
fbsql FrontBase
ibase InterBase / Firebird (requires PHP 5)
mssql Microsoft SQL Server (NOT for Sybase. Compile PHP --with-mssql)
mysql MySQL
mysqli MySQL (supports new authentication protocol) (requires PHP 5)
oci Oracle 7/8/9/10
pgsql PostgreSQL
querysim QuerySim
sqlite SQLite 2
And PHP on Windows should ship with an appropriate extension for MSSQL for PDO. Just enable
extension=php_pdo.dll
extension=php_pdo_mssql.dll
Propel should also support MSSQL, as it is written on top of PDO. And while not a full fledged ORM as such, Zend_Db has an adapter for MSSQL as well. The latter uses pdo-dblib though.