search

Home  >  Q&A  >  body text

php - Unable to connect to database


求教……

曾经蜡笔没有小新曾经蜡笔没有小新2782 days ago288

reply all(3)I'll reply

  • 给我你的怀抱

    给我你的怀抱2017-05-16 13:10:30

    1. Warning, cannot access, check if your mysql account password is wrong
    2. Error, mysql_error has been abandoned, this mainly depends on your PHP version, PHP 7 has been abandoned

    reply
    0
  • 仅有的幸福

    仅有的幸福2017-05-16 13:10:30

    Your code is wrong, it should be mysqli_connect($dbHost, $dbUser, $dbPwd). Your second parameter is $dbName.

    In addition, mysql_error has been deprecated, use mysqli_error instead.

    reply
    0
  • PHP中文网

    PHP中文网2017-05-16 13:10:30

    A few suggestions:
    1.mysql_error has been abandoned. Do not use it. You can use PDO or mysqli.
    2. Is the database open?
    3. Is the database name written correctly?
    4. Is the database account password incorrect?

    reply
    0
  • Cancelreply