I am trying to allow users to customize titles, descriptions, default values, etc. for form elements within the Form API. In order to implement it, I'm running a db_query within the t() function as shown in the '#title' element (code shown below). The database table name is v01_fielddata, the title value is stored in label_default and the primary key for the record is field_id and for this row, 'v01_price' is the field_id. The form rendered when variable_get was used (as shown in #default_value), so I don't believe I have a problem with the form itself. label_default is defined as a text field within the database, with a utf8_general_ci collation. I've confirmed that there is a text string within the column of that database row.
function v01_fields ($form, &$form_submit) {
$form['v01_price'] = array(
'#title' => t('%v01_price_title', array('%v01_price_title' => db_query('SELECT label_default FROM {v01_fielddata} WHERE field_id = :field_id', array(':field_id' => 'v01_price')))),
'#type' => 'textfield',
'#field_prefix' => t('$'),
'#default_value' => variable_get('v01_price', 25000),
'#maxlength' => 25,
'#size' => 20,
'#description' => t('The price you pay for your vehicle after extras and upgrades'),
);
When the form loads, I get the following error message: