Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
fix code typo
Source Link
JRL
  • 860
  • 7
  • 19

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 } 

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 } 
Source Link
JRL
  • 860
  • 7
  • 19

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 }