April 20th, 2000, 11:57 AM
I am a newbie to PHP + Mysql. I have a development environment and I have been able setup php and mysql. PHP works fine when I run non database script. MySql also works fine from command prompt, ( I can create table etc). My Problem, however is my inability to get my php script to connect to my mysql database. I have installed odbc drivers for mysql, that is, I can set a datasource that points to mysql database but I am unable (don't know) how to point my datasource from php. In most other web development language like cold fusion, i can reference my datasource from my code. I have the following questions regarding Php + mysql that I'll appreciate you answering for me.
I have gone through the readme file that comes with the distribution of php 4.0
1. Can you explain to me how to properly setup mysql + php. I have uncommented my the windows extension for mysql "extension=php_mysql.dll" in my php.ini file.
2. What is the correct location for php.ini file . I put mine in the "C:WINNTphp.ini"
3. My current environment is development for development, i am eventually going to move to production environment on a unix/linux machine.Will all the odbc connection be valid on unix? If not, is there a way making database connection portable across operating systems and platforms.
4. How do I install the php extension modules eg "extension=php_mssql.dll" or "extension=php_ldap.dll" on windows?
5. I came across function "odbc_connect()" in php how is it different from "mysql_connect".
6 . Is Odbc the only way of connecting to mysql from PHP script on the Windows NT platform.
I'll appreciate all your inputs
April 25th, 2000, 03:22 PM
Most likely, you have everything set up properly, you just haven't configured your php to communicate with mysql. Open up your php.ini file and uncomment the following line...
April 27th, 2000, 05:47 PM
...you also need to make sure that the 'extensions_dir' setting in your php ini points to the directory where the phpx_mysql.dll lives.....
you do not need odbc to connect php & mysql on NT.
you can find more install help on www.webmonkey.com & www.php.net