=== table structure: === mysql> describe estado; +-------------+-------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------------+-------------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | descripcion | varchar(45) | YES | | NULL | | +-------------+-------------+------+-----+---------+----------------+ 2 rows in set (0.04 sec) --------- === file estado-create.php (fragment): === (...) / Processing form data when form is submitted if($_SERVER["REQUEST_METHOD"] == "POST"){ $dsn = "mysql:host=$db_server;dbname=$db_name;charset=utf8mb4"; $options = [ PDO::ATTR_EMULATE_PREPARES => false, // turn off emulation mode for "real" prepared statements PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, //turn on errors in the form of exceptions PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, //make the default fetch be an associative array ]; try { $pdo = new PDO($dsn, $db_user, $db_password, $options); } catch (Exception $e) { error_log($e->getMessage()); exit('Something weird happened'); //something a user can understand } $vars = parse_columns('estado', $_POST); $stmt = $pdo->prepare("INSERT INTO estado (descripcion) VALUES (?)"); if($stmt->execute([ $descripcion ])) { $stmt = null; header("location: estado-index.php"); } else{ echo "Something went wrong. Please try again later."; } } (...) --------- === inserting by hand: === mysql> INSERT INTO estado (descripcion) VALUES ("test1"); Query OK, 1 row affected (0.04 sec)