$sqlString = "SELECT * FROM CartItems WHERE txtSessId = ?"; $sth = $dbh->prepare($sqlString); $sth->execute($session) $cartItemsRef = $sth->fetchall_arrayref({});