Jump to content

[SOLVED] Unknown MySQL Error...


gilly914

Recommended Posts

Hey There,

I just finished installing PHP on the Microsoft IIS platform... I know it is working ok, using the phpinfo(); test...

I went on by installing MYSQL. I know the installation worked, because I use the MySQL Query Browser, and I created a test database.
I tried making a test file just to test the MySQL.

I can't even connect to the database...

I dont know why... I wrote :
$Connection = mysql_connect("localhost", "user", "pass") or die(mysql_error());

The weird thing is that I don't get any error message...
Does anyone have any idea what the problem can be??? or why it doesn't respon...?


Thanks in Advance,
Gilly914!
Link to comment
Share on other sites

Ok, Almost nobody answered my post and I don't know if it's because no one knows how to solve my problem or just because no one ever ran into this same problem...

Well, after some research, I finally found out what was wrong. I decided to post this just incase someone might need it in the future...

Here's what I did :
First, I opened the php.ini file in the WINDOWS/system32 folder. I turned the "display_errors" parameter to On (Off by default).
I then got an error message, something like : "Undefined function : mysql_connect()"
I searched for it on google, php.net and mysql.com. I found out that because changes made in the newer version of PHP (PHP5), some changes need to be made to work with MySQL on IIS.

The changes are :
- Open php.ini again and uncomment the line : "extension=php_mysql.dll"
- Copy the files php_mysql.dll and libmysql.dll to your WINDOWS/system32 folder.

And thats it!!...
Restart your computer, and it should work with no problem...

You can turn the "display_errors" setting back to "Off" so you don't see all the unnessacery errors.



I hope I helped some of you folks out there that one day will decide to install PHP and MySQL on the Microsoft IIS Platform...
Link to comment
Share on other sites

[quote author=gilly914 link=topic=119970.msg492675#msg492675 date=1167327716]
Ok, Almost nobody answered my post and I don't know if it's because no one knows how to solve my problem or just because no one ever ran into this same problem...

Well, after some research, I finally found out what was wrong. I decided to post this just incase someone might need it in the future...

Here's what I did :
First, I opened the php.ini file in the WINDOWS/system32 folder. I turned the "display_errors" parameter to On (Off by default).
I then got an error message, something like : "Undefined function : mysql_connect()"
I searched for it on google, php.net and mysql.com. I found out that because changes made in the newer version of PHP (PHP5), some changes need to be made to work with MySQL on IIS.

The changes are :
- Open php.ini again and uncomment the line : "extension=php_mysql.dll"
- Copy the files php_mysql.dll and libmysql.dll to your WINDOWS/system32 folder.

And thats it!!...
Restart your computer, and it should work with no problem...

You can turn the "display_errors" setting back to "Off" so you don't see all the unnessacery errors.



I hope I helped some of you folks out there that one day will decide to install PHP and MySQL on the Microsoft IIS Platform...
[/quote]
Whenever you are developing scripts you should always turn on errors have set the error reporting to E_ALL or higher. You only turn display_errors off when you have finished development. Also I do have a thread in the FAQ/Code Snippet Repository about the undefined mysql function errors
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.