I am having trouble with this loop can anyone help?
I think it is just going into an infinite loop here.
Here is my loop:
$result_count = 0;
while($result_count < $rowcount) {
$row = pg_fetch_row($result, $result_count);
// while($row = pg_fetch_row($result,$result_count++)){
set_time_limit(2); //2 second time limit within loop
$line = '';
foreach($row as $value){
if(!isset($value) || $value == ""){
$value = "\t";
}else{
important to escape any quotes to preserve them in the data.
$value = str_replace('"', '""', $value);
needed to encapsulate data in quotes because some data might be multi line.
the good news is that numbers remain numbers in Excel even though quoted.
$value = '"' . $value . '"' . "\t";
}
$line .= $value;
}
$data .= trim($line)."\n";
}
any help would be appreciated.
Thanks,
Cameron