- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
$json = "";
$json .= "{\n";
$json .= "page: $page,\n";
$json .= "total: $total,\n";
$json .= "rows: [";
$rc = false;
while ($row = mysql_fetch_array($result)) {
if ($rc) $json .= ",";
$json .= "\n{";
$json .= "id:'".$row['id']."',";
$json .= "cltr: 'fo',";
$json .= "cell:['";
$json .= $row['secid'];
$json .="','".$row['blasttradedate'];
$json .="','".round($row['bid'],$row['decimals']);
$json .="','".round($row['offer'],$row['decimals']);
$json .="','".round($row['price'],$row['decimals']);
if(round($row['last'],$row['decimals'])) $json .="','".round($row['last'],$row['decimals']);
else $json .="', '";
// и еще много строк в том же духе
}
$json .= "]\n";
$json .= "}";