Fatal error: Call to a member function execute() on boolean

前端 未结 2 736
轻奢々
轻奢々 2021-01-27 15:54


        
2条回答
  •  青春惊慌失措
    2021-01-27 16:24

    You are combining Object Oriented style with the normal procedural mysqli style. On line 5 you use.

    mysqli_connect()
    

    and on line 12 you use.

    $connection->prepare()
    

    This will not work, if you'd change $connection to, object oriented style like you do with your prepare statement, it will work.

    $connection = new mysqli('localhost', $config['username'], $config['password'], $config['dbname'])
    

    More information can be found here http://php.net/manual/en/mysqli.prepare.php

提交回复
热议问题