n1ghtmare
Участники
- Сообщения
- 6
- Реакции
- 1
- Баллы
- 60
Здравствуйте, не могу выдать бан пользователю через php daba objects
PHP:
$host = 'localhost';
$db = '';
$dbuser = '';
$pass = '';
$charset = 'utf8';
$dsn = "mysql:host=$host;dbname=$db;charset=$charset";
$opt =
[
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
PDO::ATTR_EMULATE_PREPARES => false,
];
$pdo = new PDO( $dsn, $dbuser, $pass, $opt );
$statement = $pdo->prepare('INSERT INTO xf_user_ban(user_id, ban_user_id, ban_date, end_date, user_reason, triggered) VALUES (:user_id, :ban_user_id, :ban_date, :end_date, :user_reason, :triggered)');
$statement->execute([
'user_id' => '67',
'ban_user_id' => '1',
'ban_date' => 'UNIX_TIMESTAMP()',
'end_date' => '0',
'user_reason' => '0',
'triggered' => '0',
]);