I have already rolled my code and found the reason that it is adding two records in the database.
Function:
public static function create($table, array $params) {
$key = array_keys($params);
$value = array_values($params);
$key = "'" . implode("', '", $key) . "'";
$value = "'" . implode("', '", $value) . "'";
$sql = "INSERT INTO '" . self::$_prefix . "{$table}' ({$key}) VALUES ({$value})";
$pdo = self::get()->query($sql);
$pdo->execute();
}
Function call:
Connect::create('users', array(
'name' => 'Guilherme',
'lastname' => 'Alsdfafdves',
'email' => '[email protected]',
'username' => 'caraiosssss',
'password' => '123456',
));