准备好的陈述:阅读

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了准备好的陈述:阅读相关的知识,希望对你有一定的参考价值。

  1. $mysql = new mysqli('localhost', 'root', 'root', 'databaseName') or die('There was a problem connecting to the database');
  2. $stmt = $mysql->prepare('SELECT id, title, content FROM tableName');
  3. $stmt->execute();
  4. $stmt->bind_result($id, $title, $content);
  5.  
  6.  
  7. while($row = $stmt->fetch()) : ?>
  8.  
  9. <h2> <?php echo $title; ?> </h2>
  10. <p> <?php echo $content; ?> </p>
  11.  
  12. <?php endwhile; ?>

以上是关于准备好的陈述:阅读的主要内容,如果未能解决你的问题,请参考以下文章