Is it possible to automate the array inside the while loop and automatically assign the key name based on the row so I don't have to spell out each one?
$stmt = $conn->prepare("SELECT * FROM tickets_info WHERE ticket = ?");
$stmt->execute(array($_POST['ticket']));
if ($stmt->rowCount()) {
while ($row = $stmt->fetch()) {
$ticket = [
'name' => $row['name'],
'company' => $row['company'],
'email' => $row['email'],
'phone' => $row['phone'],
'address' => $row['address'],
];
}
}