As the title says, I'm trying to make a simple insert, but nothing has been added to the table. I am trying to print errors, but nothing is reported.
My users table has many more fields than these 4, but they should all be by default.
$query = 'INSERT INTO users (username, password, level, name) VALUES (?, ?, ?, ?)'; if($stmt = $db -> prepare($query)) { $stmt -> bind_param('ssis', $username, $password, $newlevel, $realname); $stmt -> execute(); $stmt -> close(); echo 'Any Errors: '.$db->error.PHP_EOL; }
No data, but when I look at the table in phpmyadmin, a new row is not added. I know for sure that the types are correct (strings and integers). Something is really wrong here, or is it because I ignore the other columns. I have about 8 columns in the user table.
source share