PHP XAMPP mysql. Fatal Error. I need Help.

Php code tested on IIS7 but didn't work on XAMPP.

Page 1 of 1

0 Replies - 2207 Views - Last Post: 27 July 2009 - 04:59 AM Rate Topic: -----

#1 scion33  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 18-May 09

PHP XAMPP mysql. Fatal Error. I need Help.

Post icon  Posted 27 July 2009 - 04:59 AM

Hi guys i have IIS7 and wampp installed on my laptop for testing purposes. Im studying php so i'm new to it. I need help to fix some problems when running this simple code:

 <?php
$con = mysql_connect("localhost","$ID","$Password");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("userpass", $con);

$result = mysql_query("SELECT * FROM usernpass");

while($row = mysql_fetch_array($result))
  {
  echo $row['username'] . " " . $row['password'];
  echo "<br />";
  }

mysql_close($con);
?> 



Here is the error i get:

Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at 'reading initial communication packet', system error: 0 in C:\xampp\htdocs\databasetest.php on line 2

Fatal error: Maximum execution time of 60 seconds exceeded in C:\xampp\htdocs\databasetest.php on line 2


Below are Xampp installation info about my phpmyadmin (might be usefull):

MySQL

* Server: localhost via TCP/IP
* Server version: 5.1.36-community
* Protocol version: 10
* User: root@localhost
* MySQL charset: UTF-8 Unicode (utf8)

Web server

* Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i PHP/5.2.9
* MySQL client version: 5.0.51a
* PHP extension: mysql

However I see this 2 warnings at the bottom of my phpmyadmin:

X - The additional features for working with linked tables have been deactivated. To find out why click here.
! - Your PHP MySQL library version 5.0.51a differs from your MySQL server version 5.1.36. This may cause unpredictable behavior.


I also tested this code on IIS7 with mysql and phpmyadmin installed and it worked fine.

Here is my IIS7 server info:

MySQL

* Server: MySQL host info: localhost via TCP/IP
* Server version: 5.1.36-community
* Protocol version: 10
* User: root@localhost
* MySQL charset: UTF-8 Unicode (utf8)

Web server

* Microsoft-IIS/7.0
* MySQL client version: mysqlnd 5.0.5-dev - 081106 - $Revision: 1.3.2.27 $
* PHP extension: mysql

And I see this error at the bottom of phpmyadmin aswell but only 1 warning:

X - The additional features for working with linked tables have been deactivated. To find out why click here.

I hope you guys will be able to help me fix the problem. I already tried changing the php.ini file's configuration on execution time but it didn't work. I also tried copying the libmysql.dll and replacing those on my xampp, and it didn't work aswell. As for upgrading the MySQL client, I'm not sure how to do that if that is the solution to the case. Please advise me how. All help will be appreciated. Thanks everyone.

P.S.

If however I posted in the wrong section. Please advise. Thank you.

Is This A Good Question/Topic? 0
  • +

Page 1 of 1