php/html forms and database inserting : I am going to start this off by saying -- yes I know there are other links similar to this and topics similar to this and I have read all of them and incorporated them into my code. However, I have been stuck on this question for 5 days and cannot figure it out and have tried everything I can. Basically my goal is to take a users input from an html form called socialmedia.html: 

    <html>
    <body>
    <h1> Pulse submission page </h1><br>
    <form action="action.php" method="post">
    Title: <input type="text" name="posttitle"><br><br>
    Content: <input type="text" name="content"><br><br>
    <input type="submit">
    </form>
    
    </body>
    </html>
and then send it to a php file called action.php:

    <?php
    $mysqli = new mysqli("DB HOST IP", "USER", "PASS, "DB NAME");
    if ($mysqli->connect_errno) {
        echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
    }
    echo $mysqli->host_info . "\n";
    
    
    
    $posttitle = $_POST["posttitle"];
    $content = $_POST["content"];
    
    if(isset($_POST['submit'])){
    $sql = "INSERT INTO `posts` (posttitle, content) VALUES ('$posttitle', '$content')";
    echo 'post added to database';
    }
    
    $sql = "SELECT * FROM `posts`";
     
    $res = $mysqli->query($sql);
     
    if($res->num_rows > 0){
     while($row = $res->fetch_assoc()){
     echo "ID". $row["id"]. "<br/>";
     echo "Title". $row["posttitle"]. "<br/>";
     echo "Content". $row["content"]. "<br/>";
     }
    }
    else
    {
     echo "No Record Found!";
    }
    ?>
This file is SUPPOSED to insert the user's form values into the table `posts`:
[this is the table posts][1]


and then print the whole table to a webpage-- action.php this is what it prints (with the error checks and all):

[this is the page, I blurred out the IP][2]


  [1]: https://i.stack.imgur.com/kCK42.png
  [2]: https://i.stack.imgur.com/bb8jU.png

honestly, I do not know where I went wrong and I have die extensive research at this point. It's probably going to end up being a syntax error and i'm gonna be kicking myself. It could have something to do with me using a godaddy server and the phpmyadmin and database being through there.I am using mysqli instead of PDO because PLESK and godaddy do not support PDO yet. Any advice would be greatly appreciated I hope I provided enough detail.