שלח תשובה

זירת השאלות

2158
צפיות
6
תשובות

mysql_connect – non stop waiting for locallhost… message

,‏ 7 באפריל, 2013



Hi

I am a new PHP dev .

Using Wamp and trying to connect to mysql

The function I am using is :

$connection = mysql_connect("localhost:8080", "root", "password");

for some reason It loads all of the pages that I created normally and only when this code is there it keeps on loading the page and the browser presents the message waiting for locallhost …

Any idea anyone ?


תגיות:

6 תשובות

  1. דרור טל הגיב:

    try to do this:
    $connection = mysql_connect("localhost", "root", "password", "database");

  2. Roee Silberman הגיב:

    I have created a database and tried the alternative mysql_connect command but nothing yet …

    I think that the problem is with the Wamp settings and the fact that I had to change it
    from port 80 to port 8080
    and from 3306 to 3307

    its just a hunch though …

  3. Roee Silberman הגיב:

    We have an answer ! 🙂

    I needed to change the code to include
    localhost:3307 instead of localhost:8080

    this happens because I tried to login to the new mysql port (3307) that I created and not the default one which is 3306

  4. weebo הגיב:

    להבא, http://php.net/mysql_error
    יעזור לך להתמודד מול שגיאות יותר מובנות לטיפול.

    בהצלחה 🙂

  5. Orel Ben-Yair הגיב:

    DO NOT USE Mysql_* functions; they’re deprecated. Use MySQLi or PDO. There are a lot of tutorials about them on the web. Just google one of them. (Use MySQLi only if you’re gonna use MySQL database.)

שלח תשובה