I would like to output 4 random records from the database and store them in 4 different variables. I would like to continue working with the variables. How do I get this done?
$stmt = $pdo->prepare("SELECT * FROM carditems WHERE status = ? ORDER BY rand() LIMIT 4 ");
$stmt->execute([1]);
while($row = $stmt->fetch()){
var_dump($row['idItem']);
}