Posts in sql

sep 30 2011

drupal_read_record()

Today I was teaching our Junior Developer at Webdrop all about schemas and drupal_write_record() and he asked me a pretty decent question:

What's the complementary function to drupal_write_record?

By that he meant the function that retrieves a record, given a schema and a primary key.

I gave it some thought and quickly realized that there is no such function! Maybe I'm just being a stickler but not having this function just seems silly.

So I decided to go ahead and write it: