} } $where = htmlspecialchars(trim($_REQUEST['where'])); $compress = htmlspecialchars(trim($_REQUEST['compress'])); $ini = parse_ini_file('sdcc.ini'); $regTestDb = new mysqli($ini['host'], $ini['username'], $ini['passwd'], $ini['dbname']); $query = 'SELECT * FROM regtest_results'; if ($where) { $query .= ' WHERE ' . $where; } $result = $regTestDb->query($query); if ($result) { if ($compress == 'bz2') { $out = new Bz2Csv('regression_test_results'); } else { $out = new Csv('regression_test_results'); } $out->gen_http_header(); $out->prolog($view); $out->gen_head(array('platform', 'target', 'build_number', 'date', 'regtest_name', 'failures', 'tests', 'cases', 'bytes', 'ticks', 'time_stamp')); while ($row = $result->fetch_assoc()) { $out->gen_row($row); } $out->epilog(); $out->close(); $result->free(); } else { echo 'DB Error: could not execute the database quey = ' . $query . "\n"; echo 'MySQL Error: ' . $regTestDb->error . "\n"; } $regTestDb->close();