php - 警告 : fflush() expects exactly 1 parameter, 0 给出

标签 php mysql

您好,我需要一些有关 install.php 中这段代码的帮助,该代码必须在程序之前首先运行,但它会带来一个指向 fflush 的错误,我不知道该怎么办,请帮忙?

    <?php
        fflush();

      authTableCreate();
      announceTableCreate();
      classTableCreate();
      studentTableCreate();
      classmembersTableCreate();
      attendanceTableCreate();
      assignmentTableCreate();
      messageTableCreate();
      supportTableCreate();


      if (!authCheckUserExists('admin')) { // this is their first install probably
          $randpass = 'admin' . mt_rand();
          authAddUser('admin', $randpass, 100, 100);   // create default superuser account
          announceAddAnnouncement('Welcome', 'This is the default start page for IntraSchool.  You should change this to something that describes how the system works within your school.');
    ?>  

    <p>Congratulations!  You have successfully setup <em>IntraSchool</em>.  You may now <a href="login/login.php">login</a> with the username <em>admin</em> and password <em><?=$randpass?></em>.  Please change the password to something you can remember.</p>

    <?php
      } else {
    ?>

    <p>The installation script has reinitialized any deleted tables.</p>

    <?php
      }

      page_footer();
    ?>

最佳答案

fflush() 需要刷新文件的句柄。这可能是 flush() 的拼写错误,但是因为它显然位于文件的开头,所以根本不会执行任何操作。您应该删除该行。

但这只是一个警告,因此脚本的其余部分可能已被执行。如果它是一次性安装脚本,那么您可能不需要再次运行它。

关于php - 警告 : fflush() expects exactly 1 parameter, 0 给出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23397285/

相关文章:

php - 使用 group by 子句对两列数据进行分组

php - Freebase MID 数组并向 freebase 发送多个查询

php - PHP 中的通用数据库连接

php - 限制发送到服务器的客户端请求的数量

mysql - 对 MySQL 表进行分区后创建索引?

mysql - Django MySQL 连接中的 SSL 错误(2026 SSL_CTX_set_tmp_dh 失败)

php - 排除字段值为空的结果

php - mySQL中根据某个select进行计数

满足条件的 PHP 查询必须出现在第二个表中

sql - 多列(每种类型一列)与单个 TEXT/Clob 列