I've got this:
$flag = false;
while($row = mysql_fetch_array($result)) {
if (!$flag) {
echo implode(",", array_keys($row));
$flag = true;
}
$drs = array();
foreach ($row as $f => $v) {
array_push($drs, "$v");
}
echo implode(",", $drs)."<br><br>";
}
However, at the top for my header row to identify the column names, it outputs this:
0,id,1,p_name,2,sales_rep,3,req_name,4,phone,5,email,6,req_date,7,pre_app_date,8,approve_by,9,promo_date,10,promo_q,11,sponsored,12,participants,13,objective
I don't want those numbers in there.
And then, in the actual fields themselves, everything is getting output twice, my guess is to correspond to the numbers you see above for each of the column names.
Is there any way to fix this? I can't find any good tutorials on coding this. 🙁