[英]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.