First off, little tip... the more code you show from the start, the better the solution can be dialed in.
Next, again there is NO reason in modern code for colours to be set in the markup. In general 99.99% of the time you use style="" you're screwing things up as that's NONE of the server side code's business.
Next... I'm not 100% sold that's tabular data, at least not from how you're presenting it. If it is tabular data, those DIV should be TD and if you want the layout different from that, use flex or grid.
Next... don't waste memory and processing time copying stuff into an array when you could just output it! This is doubly silly since you're dumping it into an array then dumping your HTML into a string -- don't do that!
Hence something more like:
function install_insert_reminders_and_clients_database() {
global $DB, $DISPLAY;
// Client Insert Limit:
$limit = 20;
// Basically the file containing all the demo people names
require_once ROOT_PATH . "create_client.php";
// Function for creating the random VRM:
require_once ROOT_PATH . "create_vrms.php";
// USER PDO Prepared Query:
$insertUser = $DB->prepare("
INSERT INTO wp_users (
user_email, user_registered
)
VALUES (
:email, NOW()
)"
);
// Reminder Data PDO Query:
$insertReminder = $DB->prepare("
INSERT INTO wp_mots (
mot_vrm, mot_expiry, mot_uid, mot_added
)
VALUES (
:vrm, :expiry, :userid, NOW()
)"
);
echo '
<table class="inserts">
<tbody>';
$insertCount = 0;
do {
$plate = create_vrm();
$client = create_client();
$expiryDate = date("Y-m-d", mt_rand( strtotime("2019-01-01"), strtotime("2023-01-01") ));
// Create the client email address...
$email = 'test_' . strtolower($client['surname'] . '.' . $client['first']) . '@example.co.uk';
$insertUser->bindParam( 'email', $email );
$insertUser->execute();
$plate = strtolower($plate);
$lastId = $DB->lastInsertId();
$insertReminder->bindParam( ':vrm', $plate );
$insertReminder->bindParam( ':expiry', $expiry );
$insertReminder->bindParam( ':userid', $lastId );
$insertReminder->execute();
echp '
<tr>
<td>', ++$insertCountl, '</td>
<th scope="row"><div>', $plate, '</div></th>
<td>
',$client['firxt'], $client['surname'], '<br>
', $email, '<br>
', $expiry, '
</td>
</tr>';
} while (--$limit);
echo '
</tbody>
</table>';
}
Ditching that string addition mental midgetry... or if you are derping it into a string for that equally derpy looking "DISPLAY" object, still do it in this order rather than making that extra Array for nothing.