$midnight = strtotime("00:00:00");
$mongo = new Mongo();
$database = $mongo->selectDB('streamStats');
// loads up all the MySQL table names from a given database then calls:
function copyDataFromSQLTableToMongoCollection($tableName, $streamId)
{
global $midnight, $dbc, $database;
$collection = $database->selectCollection("stream$streamId");
$sql = "select timestamp, value from $tableName where timestamp < $midnight";
foreach( $dbc->query($sql) as $row )
{
$document = array(
'timestamp' => $row['timestamp'],
'value' => $row['value']
);
$collection->insert($document);
}
}
The script executes fine and the data is transferred successfully, but the script output always ends with "Segmentation Fault", which I'm worried about for production. How do I get the details of the segfault for you?
Thanks!
Bob.