time_taken_updated = db_update('quiz_node_results') ->fields(array( 'time_taken' => $time_taken , )) ->condition('result_id', $result_id, '=') ->execute();
but it's better to do it with Entity_Metadata_wrapper in your hook_form_submit
like
$saq_results = entity_load('quiz_result', array($result_id)); $saq_results_wrapper = entity_metadata_wrapper('quiz_result', $saq_results); $saq_results_wrapper->time_taken->set($time_taken);
No comments:
Post a Comment