duanyou_1254
my name is Tao Tao
2021-01-22 15:00

php mysql_query 在while里报错Deprecated: mysql_query()

  • php
  • mysql

php mysql_query 在while里报错Deprecated: mysql_query(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in

<?php 

if (mysql_num_rows($yxm) > 0) {
    // 输出数据
    while($yxmn = mysql_fetch_assoc($yxm)) {
$yxlist = mysql_query("select * from typecho_fields where cid='203' and name='host' limit 1");//报错行//报错行//报错行//报错行
$yxmmn = mysql_fetch_array($yxlist);
        echo  "<span>".$yxmn["title"]."</span><span>".$yxmmn["str_value"]."</span>";
		
    }
} else {
    echo "0 结果";
}
?>

把 报错行 放在while外面就能查询 

小白在线求解答

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答