简体   繁体   English

从特定的mysql表列中检索数据值并在php中打印

[英]Retrieve data values from specific mysql table column and print in php

I am trying to retrieve all values from the column country_name and table ban_country_ip and after print them: 我正在尝试从列country_name和表ban_country_ip检索所有值,并在打印它们后:

<?php
 include("config.inc.php");
 $countryiso = mysql_query("SELECT distinct(country_name) as country_name FROM ban_country_ip");
while ($row = mysql_fetch_assoc($countryiso)) {
 echo $row['country_name'];
}

Distinct不是mysql中的函数,请改用以下查询

"SELECT distinct country_name FROM ban_country_ip"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM