Inserting data with special characters in SQL SERVER

0

I'm having trouble making a registration, it does the correct data insertion, however I'm having problems with special characters even though I have defined

<meta charset="UTF-8">

In pure php

header('Content-Type: text/html; charset=utf-8');
echo '<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">';//ISSO FOI UMA MEDIDA DE DESESPERO PARA TENTAR CORRIGIR

When saving by ide I left the Formatting as UFT-8 also

I'm using the SGDB Sql Server 2016 Enterprise

Data insertion code snippet

<?php
include('global.php');
header('Content-Type: text/html; charset=utf-8');
echo '<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">';
co();
if(isset($_POST["EventON"]))
{
    if(VerificaEquipe() < 5) die("Sem permissão");
    $idevento = $_POST["idevento"];
    $titulo = $_POST["titulo"];
    $descricao = $_POST["desc"];
    $descitens = $_POST["itens"];
    $tipoevento = $_POST["typeevent"];
    $inicio = date('Y-m-d H:i:s', time());
    $fim = $_POST["end"];
    $itensview = $_POST["isvisible"];
    if(empty($idevento) || empty($titulo) || empty($descricao) || empty($descitens) || empty($fim))
    {
        echo '<script type="text/javascript">alert("Todos os campos devem ser preenchidos corretamente.");window.location="";</script>';
    }
    else
    {
        odbc_exec($conn1, "INSERT [{$dataBaseTank}].[dbo].[Active] ([ActiveID], [Title], [Description], [Content], [AwardContent], [HasKey], [StartDate], [EndDate], [IsOnly], [Type], [ActionTimeContent], [IsAdvance], [GoodsExchangeTypes], [GoodsExchangeNum], [limitType], [limitValue], [IsShow], [ActiveType], [IconID]) VALUES ($idevento, N'$titulo', N'$descricao', N'$descricao', N'$descitens', $tipoevento, N'$inicio', N'$fim', 0, 0, NULL, 0, NULL, NULL, NULL, NULL, $itensview, 0, 0)");
        echo '<script type="text/javascript">alert("Evento Adicionado com sucesso, agora adicione os itens e não se esqueça de atualizar a xml na request!");window.location="?page=eventitens";</script>';        
    }
}
qc();
?>

After inserting data into sql server

    
asked by anonymous 29.03.2018 / 18:07

0 answers