2017-03-07 2 views
0

나는 그것을 쉽고 빠르게 이해하려고 노력할 것입니다. PHP로 프로젝트를 진행하는데 문제가 있습니다. 문제를 해결할 수 없으며, 내 웹 사이트에 CKEditor 인스턴스가 있습니다.CKEditor가 utf-8에 저장되지 않음

<script src="assets/ckeditor/ckeditor.js" charset="UTF-8"></script> 

<textarea class="ckeditor" name="editor1" id="editor" rows="10" cols="80" required value="<?php if($error) echo $profdesc; ?> "> 
      <?php echo $profdesc; ?> 
    </textarea> 

    <script> 
     CKEDITOR.replace('editor1', { 
     contentsCss: "assets/ckeditor/test.css", 
     uiColor: '#428bca', 
     extraPlugins: 'wordcount,lineheight,colorbutton,smiley', 
        wordcount: { 
         showWordCount: true, 
         showParagraphs: false, 
         showCharCount: true, 
         maxCharCount: 3000, 
         paragraphsCountGreaterThanMaxLengthEvent: function (currentLength, maxLength) { 
          $("#informationparagraphs").css("background-color", "crimson").css("color", "white").text(currentLength + "/" + maxLength + " - paragraphs").show(); 
         }, 
         wordCountGreaterThanMaxLengthEvent: function (currentLength, maxLength) { 
          $("#informationword").css("background-color", "crimson").css("color", "white").text(currentLength + "/" + maxLength + " - word").show(); 
         }, 
         charCountGreaterThanMaxLengthEvent: function (currentLength, maxLength) { 
          $("#informationchar").css("background-color", "crimson").css("color", "white").text(currentLength + "/" + maxLength + " - char").show(); 
         }, 
         charCountLessThanMaxLengthEvent: function (currentLength, maxLength) { 
          $("#informationchar").css("background-color", "white").css("color", "black").hide(); 
         }, 
         paragraphsCountLessThanMaxLengthEvent: function (currentLength, maxLength) { 
          $("#informationparagraphs").css("background-color", "white").css("color", "black").hide(); 
         }, 
         wordCountLessThanMaxLengthEvent: function (currentLength, maxLength) { 
          $("#informationword").css("background-color", "white").css("color", "black").hide(); 
         } 
        } 
       }); 
    </script> 

모든 것이 내가이 편집기와 "설명"을 업데이트 할 때까지, 나는 적어도 UTF-8로 내 모든 표와 MySQL이 있거나 .. 잘 작동 :

이것은 설정하고 인스턴스이다 나는 그것이 있다고 생각한다. UPDATE SQL에 문제가있을 수 있습니다. 여기 나머지 코드가 있습니다. 이 경우 DB에 "Olá"를 저장하려고합니다.

if(mysqli_query($con, "UPDATE users SET username='" . $name1 . 
     "',description='" . $descr . "',gender='" . $gender . 
     "',location='" . $location . "',ocupation='" . $ocupation . 
     "' WHERE user_id = '" . $_SESSION['usr_id'] . "'")) 

이는 DB에 대한 결과는 다음과 같습니다 enter image description here

+0

열/테이블이'문자 세트 UTF8이 있는지 확인 '(또는 utf8mb4) –

답변

1

내가 그것을 해결하기 위해 관리! 전과

mysqli_set_charset($con, 'utf8'); 

: 내가해야 할 일을했을 모두는 넣어했다

if(mysqli_query($con, "UPDATE users SET username='" . $name1 . "',description='" . $descr . "',gender='" . $gender . "',location='" . $location . "',ocupation='" . $ocupation . "' WHERE user_id = '" . $_SESSION['usr_id'] . "'")) { 

을 그리고 결과였다 "올라"