Syntax error in MySQL INSERT INTO statement : <p>there is some problem with my code. Everytime I try to insert something into the database, I get the syntax error.</p>

<p>Here is my database structure:</p>

<pre class="lang-sql prettyprint-override"><code>CREATE TABLE `notes` (
  `id` int(12) NOT NULL,
  `type` varchar(15) NOT NULL,
  `title` varchar(43) NOT NULL,
  `text` varchar(43) NOT NULL,
  `group` varchar(32) NOT NULL,
  `uid` int(64) NOT NULL,
  `creator` int(64) NOT NULL,
  `insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

ALTER TABLE `notes`
  ADD PRIMARY KEY (`id`);
ALTER TABLE `notes`
  MODIFY `id` int(12) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=79;

</code></pre>

<p>And thats my code</p>

<pre class="lang-php prettyprint-override"><code>&lt;?php
    session_start();
    require '../config.php';

    $notetype    = $_POST['type'];
    $notetitle   = $_POST['title'];
    $notetext    = $_POST['text'];
    $notegroup   = $_POST['group'];
    $noteuid     = $_POST['uid'];
    $notecreator = $_POST['creator'];
    $notetbname  = $note['tbname'];

    $conn = new mysqli($databaseconfig['ip'], $databaseconfig['user'], $databaseconfig['pass'], $databaseconfig['dbname']);

    if ($conn-&gt;connect_error) {
        die("Connection failed: " . $conn-&gt;connect_error);
    }

    $sql = "INSERT INTO $notetbname (type, title, text, group, uid, creator)
    VALUES ('$notetype', '$notetitle', '$notetext', '$notegroup', $noteuid, $notecreator);";

    if ($conn-&gt;query($sql) === TRUE) {
        echo "New record created successfully";
    } else {
        echo "Error: " . $sql . "&lt;br&gt;" . $conn-&gt;error;
    }

    $conn-&gt;close();
?&gt;
</code></pre>

<p>This is what I get as error message:</p>

<pre class="lang-sql prettyprint-override"><code>Error: INSERT INTO notes (type, title, text, group, uid, creator) VALUES ('player', 'Hello there', 'Good morning everybody', 'Cop', 3325, 103);

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'group, uid, creator) VALUES ('player', 'Hello there', 'Good morning everybody'' at line 1
</code></pre>
