Skip to content

Instantly share code, notes, and snippets.

@ItamarGronich
Created September 21, 2016 08:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ItamarGronich/9901f576a2700667141138b0756ea77c to your computer and use it in GitHub Desktop.
Save ItamarGronich/9901f576a2700667141138b0756ea77c to your computer and use it in GitHub Desktop.
db_query in drupal 6
// Same example in Drupal 6
$uid = 1;
$result = db_query("SELECT n.nid, n.title, n.created
FROM {node} n WHERE n.uid = %d", $uid);
while ($record = db_fetch_object($result)) {
// Perform operations on $record->title, etc. here.
}
// NOTE: db_fetch_object and db_fetch_array have been removed from D7!
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment