mysqli_stmt::execute() expects exactly 0 parameters, 1 given

Because mysqli::execute() does not accept any parameters. Before calling it, you have to prepare the query and then bind the params to the query. Then you have to call the execute() method. So try like this:

$query = $db->prepare(
"INSERT INTO pending_users (email, token, title_apt) VALUES (?, ?, ?, ?)"
);
$query->bind_param('ssss', $title, $email, $token, $time);
$query->execute();

For more check the documentation

Leave a Comment