登陆

求问:其它输出都正常,就是错误输出是乱码!

<?php/** * Created by runner.han * There is nothing new under the sun */header('Content-type:text/html;charset=utf-8');  include_once 'header.php';include_once 'inc/config.inc.php';$dbhost=DBHOST;$dbuser=DBUSER;$dbpw=DBPW;$dbname=DBNAME;$dbport=DBPORT;$mes_connect='';$mes_create='';$mes_data='';$mes_ok='';if(isset($_POST['submit'])){ $link =  mysqli_connect($dbhost, $dbuser, $dbpw ,$dbport);    //判断数据库连接    //if(!@mysqli_connect($dbhost, $dbuser, $dbpw)){ //if(!@mysqli_connect("localhost", "root", "root", "13306")){ if(!$link){        echo '数据连接失败,请仔细检查inc/config.inc.php的配置';  echo "Error: Unable to connect to MySQL." . PHP_EOL;        echo "Debugging errno: " . mysqli_connect_errno() ;        echo "Debugging error: " . mysqli_connect_error() ;        exit;  //exit(mysqli_connect_error());    }    $link=mysqli_connect(DBHOST, DBUSER, DBPW);    $mes_connect.="<p class='notice'>数据库连接成功!

";

# PHP
lsllsl249 天前214 次浏览

全部回复(8)我要回复

  • Guanhui

    Guanhui2020-05-13 11:07:47

    你mysql字符集设置是UTF-8吗?

    回复
    0
  • lsl

    设置了,正常用cmd mysql -u -p -P是正常连 正常读写的

    lsl · 2020-05-13 11:08:55
  • lsl

    lsl2020-05-12 01:03:43

    2图片2image.png

    回复
    0
  • lsl

    lsl2020-05-12 01:02:40

    1.试了很多方法都乱码.png

    回复
    0
  • lsl

    lsl2020-05-12 01:01:03

    为什么图片上传不了

    回复
    0
  • Storms

    报什么错误,是不是配置文件中图片大小超出?

    Storms · 2020-05-14 11:30:25
  • lsl

    lsl2020-05-12 00:59:38

    回复
    0
  • lsl

    lsl2020-05-12 00:56:55

    回复
    0
  • 取消回复发送