$result = mysql_query($QUERIES->getExportFrames()); if (mysql_num_rows($result) > 0) { $text .= "\n\nINSERT INTO frames VALUES "; } $count = 0; while ($row = mysql_fetch_array($result)) { $text .= "(" . $row[0] . ", " . $row[1] . ", '" . $row[2] . "', '" . $row[3] . "')"; $count++; if ($count < mysql_num_rows($result)) { $text .= ",\n"; } } } if (!isset($_REQUEST['exclude']) || isset($_REQUEST['exclude']) && !in_array("people", $_REQUEST['exclude'])) { //Adding poi data $result = mysql_query($QUERIES->getExportPeople()); if (mysql_num_rows($result) > 0) { $text .= "\n\nINSERT INTO people VALUES "; } $count = 0; while ($row = mysql_fetch_array($result)) { $text .= "(" . $row[0] . ", " . $row[1] . ", " . $row[2] . ", " . $row[3] . ", " . $row[4] . ", "; $text .= $row[5] . ", " . $row[6] . ", " . $row[7] . ", " . $row[8] . ", " . $row[9] . ", " . $row[10] . ", "; $text .= $row[11] . ", " . $row[12] . ", " . $row[13] . ", " . $row[14] . ", " . $row[15] . ", '" . $row[16] . "', " . $row[17] . ", " . $row[18] . ")"; $count++; if ($count < mysql_num_rows($result)) { $text .= ",\n"; } } } fwrite($output, $text);