开发者

mysql_connect() does connect to MySQL

开发者 https://www.devze.com 2023-04-12 07:08 出处:网络
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

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 m开发者_Python百科ysqli lines are uncommented. I am using Windows 7 64 bit.


Try using 127.0.0.1 instead of localhost.

0

精彩评论

暂无评论...
验证码 换一张
取 消