Address book with database tables
I think there are two major issues you should address right in the beginning when you start with PHP.

Separation of Layout and Logic

This means in general that you shouldn't mix HTML and PHP code. Later this will lead you to the MVC-Pattern.

index.php

&lt;?php
// connect to database
include("inc/dbconnect.php");

if ($_SERVER["REQUEST_METHOD"] == "POST") {
    //...
}

$result = mysqli_query($database,"SELECT * FROM contacts");

$records=array();
while($row = mysqli_fetch_array($result)) {
    $record[]=$row;
}

mysqli_close($database);

include 'template.php';


template.php

&lt;!DOCTYPE html&gt;
&lt;html&gt;
...
    &lt;tbody&gt;
        &lt;?php foreach ($records as $record):?&gt;
        &lt;tr&gt;
             &lt;td&gt;&lt;?= $record['firstName']?&gt; &lt;?= $record['lastName']?&gt;&lt;/td&gt;
             &lt;td&gt;&lt;a href="mailto:&lt;?= $record['email']?&gt;"&gt;&lt;?= $record['email']?&gt;&lt;/a&gt;&lt;/td&gt;
             &lt;td&gt;&lt;?= $record['phone']?&gt;&lt;/td&gt;
             &lt;td&gt;&lt;?= $record['email']?&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;?php endforeach;?&gt;
    &lt;/tbody&gt;
...
&lt;/html&gt;


Prevent SQL Injection

You are passing user input directly to the query you send to the database. Wikipedia will elaborate some examples in detail and shows how queries can be manipulated.

The easies way for you to prevent this, is using PHP Data Objects and Prepared Statements. I think there is no need for going in detail here if you don't have a specific question, there are many good tutorials out there. The important part is, that the user is no longer able to change the query you send to the database.

Minor issues


If you only have one database connection PHP will use this connection automatically with the mysqli_ methods so you don't have to pass the $database around.
It is best practice to leave away the final '?>' in plain php files. This will prevent that you send any whitespace after ?&gt; to the browser accidentally. (Important if you change the header later.)
echo "Everything blew up!" . mysqli_error($database); . May you should use die.