Fatal error: mysqli_connect()

后端 未结 3 490
庸人自扰
庸人自扰 2021-01-29 05:53

I know there are quite a few forums out there talking about this problem in stackoverflow but none seem helped so....trying to see if anyone else can give me a hand...

I

相关标签:
3条回答
  • 2021-01-29 06:24

    Okay, this might be an alternate solution to the problem you are facing. Not exactly an answer, though. You need to have php_mysqli.dll and other extensions in the right place. You need to check in three areas:

    1. The physical file php_mysqli.dll existence in the ext folder.
    2. Whether the directory ext is correctly referenced.
    3. Check if Apache has access and permissions to the folder.
    4. Check if you have edited the right file. There might be more than one php.ini files.

    Another simple solution would be installing a package like those below:

    1. WAMP Server (I recommend this for small and also may be for live projects)
    2. XAMPP
    3. USB Web Server
    0 讨论(0)
  • 2021-01-29 06:29

    I guess you need to install php5-mysql.

    sudo apt-get install php5-mysql
    

    And restart your apache server, and it should work fine.

    0 讨论(0)
  • 2021-01-29 06:36

    1) Make sure that php_mysqli.dll is present in your directory. 2) Does your id auto_increment? If yes, then you dont have to insert it to your table. Check your syntax. Try this:

    mysqli_query($db, "INSERT INTO books(title) VALUES('the nose')") or die(mysqli_error());
    
    0 讨论(0)
提交回复
热议问题