我想获取列的列表而不是 中的行implode,但是它给了我一个错误,但是当我使用数组的索引号时给了我一行的结果。
<?php
// this is the database connection
$session_id = session_start();
$con = mysqli_connect("localhost", "root", "", "ecommerce");
?>
<!DOCTYPE html>
<html>
<head>
<title>array</title>
</head>
<body>
<?php
$sql_select = "SELECT * FROM cart";
$run_select = mysqli_query($con, $sql_select);
$datas = [];
if(mysqli_num_rows($run_select) > 0) {
while($show = mysqli_fetch_assoc($run_select)) {
$id[] = $show;
}
}
$avengers = implode(",", $id['1']);
// i want to echo out the columns this is giving me the rows
echo $avengers;
摇曳的蔷薇