Author Topic: At my wits end .... Connecting MYSQL to PHP  (Read 1123 times)

0 Members and 1 Guest are viewing this topic.

Offline phpcoder121Topic starter

  • Irregular
  • Posts: 2
    • View Profile
At my wits end .... Connecting MYSQL to PHP
« on: March 04, 2010, 12:24:48 AM »
To begin let me tell you that I am running on Windows Home Premium 64bit; I have installed and reinstalled PHP, Apache, and Mysql numerous times ( between 5-10) and I have looked at many different tutorials and methods of how to install all three. Well,  I have gotten to the point where I have successfully installed Apache andconfigured it with PHP. And, I have installed Mysql and it runs (I checked it thorugh the command prompt, etc).

** note ** I have installed all 32 bit versions, apache 32 bit and php 32 bit with mySql 64bit, and now I am trying all three 64bit.

However, when I make a page with the code below I get an error page. As you will see from the screenshots I have my extensions working, msql working, etc. Everything should be insync; sadly, thats not the case.

** one more note ** I have put the libmysql.dll file in the windows directory,  put the php path into my environmental variables, etc.

Here are the screenshots of my issue.

http://img218.imageshack.us/img218/804/phpinfotop.png
http://img37.imageshack.us/img37/6122/phpinfomysqlapache.png
http://img197.imageshack.us/img197/9356/dbtestpageerrormysql.png
http://img85.imageshack.us/img85/6903/mysqlworkingproof.png
Quote
<?php
$con = mysql_connect("localhost","root","root");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
// some code
?>

By the way I usd all zip files, no MSI installeers. But I dont think that matters.

DOes anyone have any idea how I can solve this extremel hair-pulling nusance?
« Last Edit: March 04, 2010, 12:28:38 AM by phpcoder121 »

Offline thorpe

  • Administrator
  • 'Mind Boggling!'
  • *
  • Posts: 29,255
    • View Profile
Re: At my wits end .... Connecting MYSQL to PHP
« Reply #1 on: March 04, 2010, 12:28:38 AM »
Have you enabled the mysql extension within your php ini?

Also, in your browser, trun off 'show friendly error messages'. The error your getting isn't exactly helpful.

Offline phpcoder121Topic starter

  • Irregular
  • Posts: 2
    • View Profile
Re: At my wits end .... Connecting MYSQL to PHP
« Reply #2 on: March 04, 2010, 12:29:55 AM »
Yes I have enabled the extensions on my php.ini, isnt that why the Msql module shows up in the phpinfo page?

I did turn it off and restarted my browser still get this error......

http://img689.imageshack.us/img689/3341/dbtestnofriendly.png

just downloaded google chrome and it gave me some error that may be more helpful. Here is screenshot
http://img237.imageshack.us/i/chromeerror.png/
« Last Edit: March 04, 2010, 12:38:04 AM by phpcoder121 »