Php CKEditor未保存在utf-8中

Php CKEditor未保存在utf-8中,php,html,mysql,utf-8,ckeditor,Php,Html,Mysql,Utf 8,Ckeditor,我会尽量快速和容易理解它。我的PHP项目有一个问题,我不能做任何事情来解决它,我的网站上有一个CKEditor实例 这是配置和实例: <script src="assets/ckeditor/ckeditor.js" charset="UTF-8"></script> <textarea class="ckeditor" name="editor1" id="editor" rows="10" cols="80" required value="<?

我会尽量快速和容易理解它。我的PHP项目有一个问题,我不能做任何事情来解决它,我的网站上有一个CKEditor实例

这是配置和实例:

    <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>
这是数据库上的结果:
我设法修好了!我所要做的就是放一个:

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'] . "'")) {

结果是:“Olá”

我设法修复了它!我所要做的就是放一个:

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'] . "'")) {

结果是:“Olá”

确保列/表是
字符集utf8
(或utf8mb4)确保列/表是
字符集utf8
(或utf8mb4)