i have a total of 6 different tables that i select from then insert to a table before i do another select i was wondering if there was a way to skip the insert part and just do a select and combine all table data. the problem with the select and insert then select aproach is it gets really slow when there are about 1k+ records inserted. it takes about 30sec to 1min or more
im trying something like this
$sql = "select 1";
$statement = $conn->query($sql);
$rowset = $statement->fetchAll();
$sql1 = "select 2";
$statement1 = $conn->query($sql1);
$rowset1 = $statement1->fetchAll();
$combine = array_merge($rowset,$rowset1);
foreach ($combine as $key => $part) {
$sort[$key] = strtotime($part['date']);
}
array_multisort($sort, SORT_DESC, $combine);