When I am trying to export all fields are okay except NID field. This numbers length is 17+ so, how can I show all the numbers in this field(nid)?? I have
<?php
$filename = "hello.csv";
$query = "SELECT * FROM test_users";
$result_users = $this->conn->prepare($query);
$result_users->execute();
// Create array
$list = array ();
// Append results to array
array_push($list, array("## START OF May TABLE ##"));
while ($row = $result_users->fetch(PDO::FETCH_ASSOC)) {
array_push($list, array_values($row));
}
array_push($list, array("## END OF May TABLE ##"));
// Output array into CSV file
$fp = fopen('php://output', 'w');
fputcsv($fp, ['Serial NO','English Name','Bangla Name','address','bn_address','user_no','nid','previous_cm','meter_no','type_of_user']);
header('Content-Type: text/csv; charset=utf-8');
header('Content-Disposition: attachment; filename="'.$filename.'"');
header("Content-Transfer-Encoding: binary");
foreach ($list as $ferow) {
fputcsv($fp, $ferow);
}