-1

I am in a terrible situation. My PHP works with MySQL database when I use MySQLi connection code, but when I try to connect the database using

<?php
    mysql_connect("localhost", "admin", "1admin") or die(mysql_error());
    echo "Connected to MySQL<br />";
?>

I don't get any error message. Rather the browser just goes offline or error message. I have been trying to figure this out for two weeks.

In my PHP both MySQL and mysqli lines are uncommented. I am using Windows 7 64 bit.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131

1 Answers1

1

Try using 127.0.0.1 instead of localhost.

Esselans
  • 1,540
  • 2
  • 24
  • 44