search

Home  >  Q&A  >  body text

Unable to submit data

出错:function construct()

Fatal error: Cannot redeclare construct() (previously declared in

岸上鱼岸上鱼1161 days ago999

reply all(2)I'll reply

  • autoload

    autoload2021-09-28 10:12:43

    The error screenshot is complete. The current error shows that the constructor has been declared repeatedly

    reply
    0
  • 岸上鱼

    There is no duplication. It is the package below. There is no problem in face-to-face testing. function MySQLModel(){ $link = null; function mylink(){ // include 'conn.php'; // $link = mysqli_connect(HOST,USER,PASS,DBNAME) or die('Prompt: Database connection failed!'); define("HOST","localhost"); //Host name define("USER","root"); //Account define("PASS","root"); //Password define("DBNAME","fanfancy"); //database name $link = mysqli_connect(HOST,USER,PASS,DBNAME) or die('Prompt: Database connection failed!'); return $link; } $link = mylink();

    岸上鱼 · 2021-09-28 11:29:19
  • Cancelreply