$stmt =$this->db->prepare("select * from abstract where account_name=:account_name");
$stmt->bindparam(':account_name',$name);
$stmt->execute();
$getAccountInfo=$stmt->fetchAll();
return $getAccountInfo;
csv文件概念是
if (isset($_POST['xyz'])) {
$randnum = rand(1111111111,9999999999);
if (isset($data['0'])) {
$fp= fopen("contacts_$randnum.csv","w");
foreach ($data AS $values) {
fputcsv($fp, $values);
}
fclose($fp);
}
}
当我提交帖子请求时,我收到带有重复列的csv文件
答案 0 :(得分:2)
尝试
$getAccountInfo=$stmt->fetchAll(PDO::FETCH_ASSOC);