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.
added 2 characters in body
Source Link
Jay Blanchard
  • 34.5k
  • 17
  • 82
  • 130

If you use fetch() with the PDO::FETCH_ASSOC style it is easy to get both columns:

while($row = $sth->fetch(PDO::FETCH_ASSOC) { echo $row['prod_url']; echo $row['ean']; } 

By placing the fetch in a loop all of the rows will be returnreturned which you can then limit as you see fit.

If you use fetch() with the PDO::FETCH_ASSOC style it is easy to get both columns:

while($row = $sth->fetch(PDO::FETCH_ASSOC) { echo $row['prod_url']; echo $row['ean']; } 

By placing the fetch in a loop all of the rows will be return which you can then limit as you see fit.

If you use fetch() with the PDO::FETCH_ASSOC style it is easy to get both columns:

while($row = $sth->fetch(PDO::FETCH_ASSOC) { echo $row['prod_url']; echo $row['ean']; } 

By placing the fetch in a loop all of the rows will be returned which you can then limit as you see fit.

Source Link
Jay Blanchard
  • 34.5k
  • 17
  • 82
  • 130

If you use fetch() with the PDO::FETCH_ASSOC style it is easy to get both columns:

while($row = $sth->fetch(PDO::FETCH_ASSOC) { echo $row['prod_url']; echo $row['ean']; } 

By placing the fetch in a loop all of the rows will be return which you can then limit as you see fit.