我想获取mysql_query(设置名称' utf8')数据,但无法插入脚本

时间:2018-03-20 12:13:38

标签: mysql character

获取数据的代码

$db = mysql_connect("localhost","root","","news");
   mysql_query("set names 'utf8'");   
      $result = mysql_query($db, "SELECT * FROM  news_list order by id LIMIT 0,4");
    while ($row = mysqli_fetch_array($result))
            { ?>
    <li>
            <a href="#?id=<?php echo $row['id']; ?>" class="">
                <div class="">
                    <img width="64" height="64" src="<?php echo $row['images']; ?>" class="" alt="" itemprop="image" />   </div>
                <div class="">
                  <?php echo substr($row['description'], 0, 50); ?>  తెలుగు     </div>
            </a>
    </li>

                    <?php  } ?>

在这只是我需要添加设置字符集utf8

1 个答案:

答案 0 :(得分:-1)

{{1}}