【发布时间】:2020-09-29 15:45:26
【问题描述】:
我的目标:将来自查询的项目数组插入到变量中,然后打印出来
步骤:
- 启动查询
- 用php做点什么
- 打印变量
$report = 'this is your list: $list';
试过这个:
$myquery = mysqli_query($dbconnection, "SELECT ...");
while($row = mysqli_fetch_assoc($myquery)) {
$my_array = $row['field'];
echo "$my_array, "; /* here I've the full list*/
}
$report = 'this is your list:' .$my_array. '.';
echo "$report"; /*I've only one item and not all the list*/
【问题讨论】:
-
所有基本问题都已经回答了好几次。在发布新问题之前,请通过搜索 Stackoverflow 来享受丰富的现有知识。
-
谢谢。我达到了我的目标,而不是使用 php,而只是在 mysql 查询中添加一个“GROUP_CONCAT”