You can't fetch from the DB multiple times like this. Do this instead:
$orders = $ordersQuery->fetchAll(PDO::FETCH_ASSOC); ... foreach ($ordersQuery$orders as $val) { // stuff 1 } ... foreach ($ordersQuery$orders as $val) { // stuff 2 } Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about CollectivesStack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
Explore Stack InternalYou can't fetch from the DB multiple times like this. Do this instead:
$orders = $ordersQuery->fetchAll(PDO::FETCH_ASSOC); ... foreach ($ordersQuery$orders as $val) { // stuff 1 } ... foreach ($ordersQuery$orders as $val) { // stuff 2 } You can't fetch from the DB multiple times like this. Do this instead:
$orders = $ordersQuery->fetchAll(PDO::FETCH_ASSOC); ... foreach ($ordersQuery as $val) { // stuff 1 } ... foreach ($ordersQuery as $val) { // stuff 2 } You can't fetch from the DB multiple times like this. Do this instead:
$orders = $ordersQuery->fetchAll(PDO::FETCH_ASSOC); ... foreach ($orders as $val) { // stuff 1 } ... foreach ($orders as $val) { // stuff 2 }