Guys I am really stuck up here with this Access DB. I made a php application for a company, the record exporting to MS access in the web application is giving me headache.
I installed Xampp 1.8.1x32 and MS office 2010 32bit professional in their Windows 2008 64 bit version server, everything is working fine! I enabled extension=php_pdo_odbc.dll in the php.ini and I tried to export data from mysql to accdb file using php PDO, but it's not inserting data into the accdb file.
I even tried adding a system DSN to the accdb file in both ODBC 64bit and ODBC 32bit by installing "Access Database Engine x64" and "Access Database Engine x32", but still out of luck. The same mysql to accdb data exporting is working fine in my win7 x64 and ms office 2010 x32 even without installing access database engine and without setting DSN!
Kindly let me know whether there is some other way out to insert data into accdb using PDO in Win 2008x64 server edition. Should I install any special access database edition in win 2008, or should I enable something to make it work?
Sorry for this lengthy and twisted post :p I didn't find solution anywhere else in the internet. Kindly help!
Update: There is no PDO or php errors displayed. just it's not working!
I experienced the same problems. I was able to read and display records but INSERT had no effect, no error was thrown either. The thing is, I kept trying to execute an SQL statement with the values already filled out. Once I tried the prepare and execute statements with actual parameters it did work. I have no idea why it behaves this way but it seems like you can't directly execute INSERT statements?
Btw I previously tried 'prepare - execute' with no arguments as well ( as the data was filled out in the query already ). Glad it only took me 3 hours of trial and error! :(
Related
Please bear with me.. I am not entirely sure how to ask this question. I hope someone catches on.
I do my PHP (7.4 and 8.0) programming in FreeBSD, connecting to Windows based SQL servers using PDO_ODBC. In FreeBSD, I successfully use FreeTDS to pull data over ODBC and everything works.
What I am developing is meant to run on XAMPP or WAMP (or any similar stack) on a Windows Server of recent flavor, but when I copy the PHP code over, my query fails. I have set up a 64bit DSN which successfully connects to the target database and I can run queries against the database - at least in simple terms. The code I am trying to migrate contains a fairly complex query and running it on this platform return 0 data to the PDO. It runs fine in SQL Management Studio.
So the question is very open ended, but for now: Why or what?
I need to make a connection with PHP to a database created with Paradox (about the year 2004, I think). It is a very old database and there is no way to find information online.
I have tried with xampp, wamp but they do not bring by default any library that can read that type of database from PHP. I have read on the internet that xampp (for example) stopped giving support to Paradox on the year 2008. I imagine that wamp the same.
So, does anyone have any experience with this type of database? I would appreciate any kind of guidance on this subject.
I answer to myself in case someone else has to work PHP (4, 5.x, 7...) with the Paradox database and they have this problem too.
The first is to create a connection odbc with the tool: "ODBC data source". This program comes installed in windows by default.
In the tab: "System DSN", optcion "Add".
Search for the connection "Microsoft Paradox Driver (* .db)", accept it. Add a name and select the directory where we have our database.
Finally, edit the php.ini file and add (or uncomment) these lines:
extension = php_odbc.dll
extension = pdo_odbc
With this we will be able to work with paradox databases in any version of PHP.
I'm currently working on a project that has to write to both MSSQL and a Sybase database.
I'm working on a Microsoft Server 2008 R2 server with IIS 7 and PHP installed (cause I've got to work in PHP.)
When in IIS-management I go to the PHP manager, and try to activate the sybase extension (php_sybase_ct.dll). It gets transferred to the activated group, but when I run my script I keep getting "undefined function sybase_pconnect();"
What am I doing wrong? The .dll is in place, it is activated in the .ini file. What is the problem?
Hope someone can help me, cause from looking around the internet, I've seen a lot of problems with PHP and sybase.
The PHP client download page for Sybase states
The PHP modules require SQL Anywhere 10.0.1.3767 or greater.*
You can download the SQL Anywhere database client here.
If the SQL Anywhere client libraries are missing (or not found by PHP), you'd get exactly the symptoms you're getting.
Need some guidance figuring out what went wrong. I've been using mysql, phpmyadmin for just under a year on my home computer while I develop a webapp. 3 days ago I updated my windows vista with all the "wonderful" microsoft updates, security patches, etc...and now it's broke. I tried uninstalling all the upgrades, but there are 4 of them I can't unistall because microsoft says their "operating system" updates and can't be unistalled.
My system is: windows vista, php 5+, mysql 5.1, Apache 2+.
I can run my web app and it queries the database without any problems. However, when I run phpmyadmin to get into the database I get an error: "mysqld.exe has stopped working" and phpmyadmin crashes. I tried going to the command line for mysql to do a mysqldump to backup my database and it gives me an error "2013, could not connect to the server". If I restart the computer the webapp will work again. Basically, php can query the database, but if I try to get at the database through phpmyadmin, or the command prompt the mysqld.exe error occurs and blows mysql out.
Any ideas what's going on here? Any ideas how to get around this to backup the db, so I can reinstall mysql?. I'm really lost where to start. I don't really know if the updates caused the problem, or if the 4 updates that can't be unistalled are really the problem.
Any tips will be appreciated. thanks.
You could try using XAMPP. It has PHP, MySQL, Apache, and other stuff all in one easy to use package.
After a software/ hardware drivers update, it may happened that the service mysqld.exe crashes at each launch (usually with message: mysqld.exe encountered an error and needs to close)
Check the solution described here (it worked for me) if you wish to avoid mysql reinstall.
I have on my local PC installed WAMP environment (using WampServer OS).
Now I would need to change one script from working with MySQL to MSSQL.
I have no idea at all how to proceed, where to download MSSQL, how to install it and how to connect with PHP?
Thank you very much
Download mssql express http://www.microsoft.com/Sqlserver/2005/en/us/express.aspx
Familiarize yourself with one of the great database abstraction layers, for example PDO http://www.php.net/pdo
Refactor your code to use the database abstraction layer
You may need to rewrite the mysql specific things to "standard" SQL
Start by getting Sql Server working. If you are using an old copy of Sql Server (pre 2005) you will need to make sure ntwdblib.dll is present in your System32 directory, and removed from your PHP dll directory (ntwdblib.dll is installed with the enterprise tools, so you may have to install them on your PHP box as well). Once you have Mssql querying properly, start finding where Mssql differs from MySql in your code.
A couple of tips:
The ntwdblib doesn't accept long strings (I think it is limited to 4k, but don't quote me on that). You have to use Stored Procs if you are trying to process a string longer than 4k.
Try to use Sql Server 2005 if you can (see above), the ntwdblib.dll is ancient and has numerous issues.
The PHP site is your friend for mssql.