1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Rep Power
    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

  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Rep Power
    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...

  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Rep Power
    ...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

Similar Threads

  1. Mysql problem.
    By Nik in forum MySQL Help
    Replies: 54
    Last Post: December 21st, 2006, 06:02 PM
  2. Check MySQL Version thru PHP
    By wolftrap1 in forum PHP Development
    Replies: 2
    Last Post: February 11th, 2004, 08:51 PM
  3. Replies: 5
    Last Post: February 11th, 2004, 02:18 AM
  4. Replies: 0
    Last Post: February 10th, 2004, 11:44 PM
  5. Replies: 0
    Last Post: January 30th, 2004, 01:22 PM

IMN logo majestic logo threadwatch logo seochat tools logo