Skip to content

Instantly share code, notes, and snippets.

@alancoleman
Last active December 28, 2015 02:39
Show Gist options
  • Save alancoleman/7429586 to your computer and use it in GitHub Desktop.
Save alancoleman/7429586 to your computer and use it in GitHub Desktop.
Drupal 6 -> Drupal 7 Module upgrade
<?php
# db_fetch_object
// Drupal 6
while ($record = db_fetch_object($result)) {
// Do stuff with $record, which is an object
}
// Drupal 7
foreach ($result as $record) {
// Do stuff with $record, which is an object
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment