Bug #36096 PHP script cannot connect to mysql db

Submitted: 15 Apr 2008 16:21 Modified: 15 Apr 2008 17:49
Reporter: Paul Gathogo Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:5.0 OS:Windows (Vista- Busines Edition)
Assigned to: CPU Architecture:Any
Tags: MySQL, php, vista

[15 Apr 2008 16:21] Paul Gathogo
Description:
Am trying to do a simple mysql database connection from my php script but the connection fails.
Am runnining PHP 5, Mysql 5, Apache 2.2 and MS Windows Vista Business Edition.

My code looks like this:

<?php

  $echo " Connecting to database ...";

  $conn = mysql_connect("localhost","user","passwd");

  if (!$conn)
  {
    die('Failed to connect!'.mysql_error());
 }

  if ($conn)
  {
    echo "Connected !! ";
  }

?>

The code does not go past the mysql_connect() function.

Please help.

Paul

How to repeat:
Run this script on:

Windows Vista Business Edition,
Php5
mysql5
apache2.2

<?php

  $echo " Connecting to database ...";

  $conn = mysql_connect("localhost","user","passwd");

  if (!$conn)
  {
    die('Failed to connect!'.mysql_error());
 }

  if ($conn)
  {
    echo "Connected !! ";
  }

?>

Suggested fix:
[15 Apr 2008 17:49] MySQL Verification Team
We're sorry, but the bug system is not the appropriate forum for asking help on using MySQL products. Your problem is not the result of a bug.

Support on using our products is available both free in our forums at http://forums.mysql.com/ and for a reasonable fee direct from our skilled support engineers at http://www.mysql.com/support/

Thank you for your interest in MySQL.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.049 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.