1
A
回答
2
用途:
<?php
$query = "SELECT GROUP_CONCAT(t.email) AS emails
FROM YOUR_TABLE t"
// Perform Query
$result = mysql_query($query);
while ($row = mysql_fetch_assoc($result)) {
echo $row['emails'];
}
// Free the resources associated with the result set
// This is done automatically at the end of the script
mysql_free_result($result);
?>
个
参考文献:
0
三打在谷歌为“PHP的MySQL”:http://www.freewebmasterhelp.com/tutorials/phpmysql
你可能需要在基础读了,它并不复杂,只需要几分钟的时间浏览一下它,让你开始。
0
选项1:
$sql = "SELECT GROUP_CONCAT(email ORDER BY email ASC SEPARATOR ', ') AS emails FROM emails";
$res = mysql_query($sql);
list($emails) = mysql_fetch_row($res);
echo $emails;
选项2,这样你就可以与所有的电子邮件做多等一会:
$emails = array();
$sql = "SELECT email FROM emails ORDER BY email ASC";
$res = mysql_query($sql);
while ($r = mysql_fetch_object($res)) {
$emails[] = $r->email;
}
// as a list
echo implode(', ',$emails);
// or do something else
foreach ($emails as $email) {
// ...
}
0
做这样的事情:
while ($output = mysql_fetch_array($query_results)) {
echo $output['id'] . ", " . output['email'];
}
相关问题
- 1. PHP在MySQL表中显示MySQL结果
- 2. PHP不显示MYSQL结果
- 3. 学习Php MySql查询,如何在PHP中显示结果?
- 4. 如何在MySQL中显示unicode结果?
- 5. 符合MySQL的显示结果在PHP
- 6. 如何在php中显示MySQL查询的结果?
- 7. 如何在PHP中显示前一页的MySQL结果?
- 8. 在php中显示结果?
- 9. 如何显示在MySQL查询结果
- 10. 只显示div,如果mysql结果显示8个结果?
- 11. 相结合,在PHP中显示结果MYSQL
- 12. PHP从MySQL显示搜寻结果时
- 13. 显示前5条结果PHP MySQL
- 14. 通过PHP显示MYSQL结果的值
- 15. 显示动态结果PHP mySQL
- 16. PHP和MySQL - 更新后显示结果
- 17. 显示MySQL查询结果参数PHP
- 18. PHP JSON不显示MySQL结果
- 19. 显示group_concat结果在php
- 20. 在PHP中显示结果在MySQL中出错
- 21. 显示结果PHP
- 22. 显示PHP结果
- 23. 如何并排显示MySQL结果
- 24. 如何在多个表中搜索php mysql并在表中显示结果
- 25. MySQL结果不显示在表中?
- 26. 在子表中显示mysql结果?
- 27. 仅在MySQL中显示查询结果
- 28. MySQL: - 在一行中显示结果
- 29. 在FPDF中显示Mysql的结果
- 30. 如何显示salesforce的结果PHP arrayp