I am trying to connect php with interbase. It seems php only works with firebird, instead of interbase. I already have a database , that is created in interbase, I just need connectivity with interbase, not firebird. When I am trying to connect it with interbase, it says .. invalid database. where as connection with firebird database is working fine. Using php 5.6, windows server, 64 bit architechture
There's a ton of helpful comments at the ibase_connect function page over at php.net, are you sure that you're following through and checking version numbers? It appears that you may need to perform a manual fix and set the dialect version of the connection, as follows:
ibase_connect ('localhost:/usr/db/db.gdb', 'SYSDBA', 'masterkey', 'ISO8859_1', '100', '1' ) ;
The last 1 as a parameter resets the dialect mode between the ibase_connect() and Interbase. You also should check and see if the version of PHP you're running is compatible with the version of Interbase you're running.
Related
I have a project working with CodeIgniter and sqlserver 2008 I updated my pc to windows 10 then stopped working, the sqlserver driver for php is configured and my php ini shows it, also the code connects to sql server but now when im triying to do a query it givme false
so this code:
$this->db->select('*')->from('distritos')->get()->result();
Fatal error: Call to a member function result() on a non-object in C:\
Always its like sqlserver not working anymore but cannot fix it.
Php info shows
PDO
PDO support enabled
PDO drivers mysql, pgsql, sqlite, sqlsrv
pdo_sqlsrv
pdo_sqlsrv support enabled
Version 3.0.2.2R (Unofficial)
Unofficial Changes Works with Native Clients 11/10/9
sqlsrv
sqlsrv support enabled
Version 3.0.2.2R (Unofficial)
Unofficial Changes Works with Native Clients 11/10/9
EDIT:
its my mistake cannot conect
Unable to connect to your database server using the provided settings.
Filename: C:/www/***/system/database/DB_driver.php
Line Number: 436
the database config its okay :S
The error wasnt on the config, was on the password that was expired but the code igniter wasn't showing the error becouse i have to active this config :
database.php
'db_debug' => TRUE,
Solved ;)
I'm having some issues loading some data into MySQL on Linux. I'm using LOAD DATA LOCAL INFILE. I can do it just fine on Mac OS X, specifically through the MySQL command line and a php script with a SQL query.
The issue arises when I'm on linux, it seems like LOAD DATA LOCAL is disabled per the MySQL documentation for security issues. To get around this problem, they give some possible workarounds such as using --local-infile[=1] on starting MySQL, but what am I suppose to do if I'm using PHP?
Specifically, in the command line, I get the error:
ERROR 1148 (42000): The used command is not allowed with this MySQL version
I'm also using version:
mysql Ver 14.14 Distrib 5.5.41, for debian-linux-gnu (x86_64) using readline 6.3
Any help would be greatly appreciated.
You can set it from an sql statement, assuming you have the correct permissions to change global variables;
SET GLOBAL local_infile = 'ON';
Check to see if the changes have taken effect;
SHOW GLOBAL VARIABLES LIKE 'local_infile';
I have been trying to connect to a ibm db2 database but it seems impposible. The as400 is in a different server than the one running php.
Everytime I do a db2_connect I get the following error:
Fatal error: Call to undefined function db2_connect()
How can I make this function work?
Tip: I've already tried with odbc and it was a lost of time, but I'm open to suggestions on that path as well.
[EDIT]
I finally changed to java... it was impossible with php...
Check your php.ini file and make sure it has the DB2 extension enabled. http://www.php.net/manual/en/install.pecl.php
Try this link:
http://www.theregister.co.uk/2006/08/09/db2_udb_part2/
Deals with:
Installing the PHP DB2 extension,
Creating a connection,
Obtaining a result set
Also gives as an alternative the PDO option.
But as for DB2 on the AS400, am not sure if something still needs to be installed on the
AS400 for this to work?
Anyway, have used the ODBC Client Access with no problems at all. What difficulty did you run into?
I inherited an old Cakephp site that was using adodb as a driver to connect to an MSSQL database and it turns out this is no longer supported in the new version of cake (1.3, we are in 1.2) so I'm trying to change the driver so I can upgrade. We're using IIS and a sql server 2005 database on a different server, php 5.2.17. However using driver "mssql" gives me the following errors:
PHP SQL Server interface is not installed. For troubleshooting information, see http://php.net/mssql/
Call to undefined function mssql_min_message_severity()
The top error leads me to a page regarding the old php_mssql.dll, which according to this question: ( CakePHP: error when trying to use mssql datasource ) will become a problem when I switch to PHP 5.3 so I'm trying to use the php_sqlsrv*.dll for my php version but I still get the error. Could never get the mssql.dll one to work either. I do however see "sqlsrv support enable" in phpinfo.php and the whole sqlsrv section is intact there.
In cake php I'm using "driver => 'mssql'", is this the correct driver for the new sqlsrv dll? Is there something I'm missing? For kicks I tried 'driver' => 'sqlsrv', that fixes the php SQL Server interface error but I still get
"Fatal error: Call to undefined function sqlsrv_min_message_severity() in C:\Inetpub\wwwroot\riverstone-dev\www\cake\libs\model\datasources\dbo\dbo_sqlsrv.php on line 107"
Installing the latest SQL Native Client set from Microsoft and reenabling the extension in PHP has worked, albeit on a different server. Please try the drivers below if having a similar problem:
http://www.microsoft.com/download/en/details.aspx?id=20098
I have an application that I made with PHP and MSSQL2000, but now want to connect it to a MSSQL2005 database. It's always failing and after doing some research I was told to download the ntwdblib.dll and replace the old one in my PHP directory which I did, but still cannot connect to it. I also uncommented the MSSQL extensions in my php.ini file.
Please can somebody help me with this?
http://www.php.net/manual/en/mssql.installation.php
The MSSQL extension is enabled by
adding extension=php_mssql.dll to
php.ini.
To get these functions to work, you have to compile PHP with
--with-mssql[=DIR] , where DIR is the FreeTDS install prefix. And FreeTDS
should be compiled using
--enable-msdblib .
also
MS SQL functions are aliases to Sybase functions if PHP is compiled with Sybase extension and without MS SQL extension.
<Edit>
Just asking. Do you have a mssql_connect function? Or does the connect fail? If the connection fails, be sure to enable TCP/IP in MSSQL (using SQL Server Configuration Manager). And I also recalled enabling Named Pipes, but I'm not sure it's needed.
</Edit>
As an alternative you could look at COM and ADODB.
Example of COM and ADODB, connecting to SQL Server using Windows Authentication:
$this->m_conn = new COM("ADODB.Connection");
$this->m_conn->CommandTimeout=1200;
$dsn="Provider=SQLNCLI;Data Source=server_name;Integrated Security=SSPI;Initial Catalog=database_name;Application Name=YourAppName - ".$user['name'];
$this->m_conn->Open($dsn);
if(!$this->m_conn)
throw new Exception("Could not start ADO",101);
$this->m_comm = new COM("ADODB.Command");
$this->m_comm->ActiveConnection=$this->m_conn;
$this->m_comm->CommandTimeout=1200;
Then execute a command
$this->m_comm->CommandText=$sql;
$res=$this->m_comm->Execute();
Then extract the data
if(($num_cols=$res->Fields->Count())>=1)
{
$return=array();
while(!$res->EOF)
{
$row=array();
for($i=0;$i<$num_cols;$i++)
$row[$res->Fields($i)->name]=$res->Fields($i)->value;
$res->MoveNext();
$return[]=$row;
}
}
$res->Close();
return $return;
Not sure about speed on a lot of requests, but it's a good way to do it without much fuss, and using DSNs with which you can specify much more than using function parameters.
EDIT:
You can define your own mssql_connect(), mssql_command(), etc, using ADO. That's a workaround if regular mssql extension won't work.
You can also try the build in database wrapper PDO from php.
Here is some information about PDO: PDO
And here is information on the use of MSSQL with PDO MSSQL and PDO
thank you very much for your help.
Actually i did find out a way of making it work
First of all let me start with what i have compared to the system requirements
MY SYSTEM
OS:-Win xP SP2
PHP :- 5.3.5
MSSQL 2005
SQL Native client 2005
Required
Recommended :-Win xP SP3
PHP :- 5.2.4 or later
MSSQL Server 2008 Native Client (on the same computer php is running)
SQL Server Driver For PHP
after upgrading my windows to service pack 3 i then downloaded and installed the MSSQL Server 2008 Native Client
then installed the SQL Server Driver For PHP 2.0 which ask for a directory to save the dll files.
I browse to the php directory and then the 'ext' folder where it copied the dll files to.
Then went to the php.ini file and add these two lines under the Dynamic Extensions.
extension=php_sqlsrv_53_ts_vc6.dll
extension=php_pdo_sqlsrv_53_ts_vc6.dll
Then restart my webserver and booommm....i got it working..
did a test connection to the database and it was succesfull..
Hope this will help others and thank you all for your assistance really appreciate it..
Peace