title: how to check in database for records
body: <p>i am using a simple database for a guestbook. I just can't figure out how to check if there has nobody written in the guestbook yet. Because in that case, there should be an echo: "Be the first to write in the guestbook". Otherwise, the rows should be echoed.
  How can i do that?</p>
  
  <p>Piece of the code: </p>
  
  <pre><code>if (mysqli_connect_errno($con))
  {
      echo "Connectie Database mislukt: " . mysqli_connect_error();
  }
  $result = mysqli_query($con,"SELECT name,message,email,datetime FROM guestbook");
  
      while($row = mysqli_fetch_array($result))
  { ?&gt;
  
       &lt;div class="velden"&gt; &lt;!-- voor styling van alle echo's; zie CSS --&gt;
          &lt;div class="header"&gt;
              &lt;div class="naam"&gt;&lt;?php echo $row['name']; ?&gt;&lt;/div&gt; &lt;!-- echo naam--&gt;
              &lt;div class="email"&gt;&lt;?php echo $row['email']; ?&gt;&lt;/div&gt; &lt;!-- echo email--&gt;
              &lt;div class="tijd"&gt;&lt;?php echo $row['datetime']; ?&gt;&lt;/div&gt; &lt;!-- echo datum en tijd--&gt;
  
          &lt;/div&gt;
  
          &lt;div class="bericht"&gt;&lt;?php echo $row['message']; ?&gt;&lt;/div&gt; &lt;!-- echo bericht--&gt;
  
      &lt;/div&gt;
      &lt;?php } ?&gt;
  </code></pre>
  
  <p>So there should be something like: </p>
  
  <pre><code>If(nobody has written) {
  echo 'Be the first to write in the database";
  } else {
  //do the echo's
  }
  </code></pre>