Skip to content

Instantly share code, notes, and snippets.

@Shivabeach
Created September 4, 2013 16:34
Show Gist options
  • Save Shivabeach/6439505 to your computer and use it in GitHub Desktop.
Save Shivabeach/6439505 to your computer and use it in GitHub Desktop.
PDO select with foreach inline
<?php
foreach(->query('SELECT * FROM table') as $row) {
echo $row['field1'].' '.$row['field2']; //etc...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment