Return to Snippet

Revision: 48508
at July 3, 2011 17:20 by sriganesh


Initial Code
<?php

function get_random_field_value($form_id, $field_number){
    global $wpdb;
    
    $table = RGFormsModel::get_lead_details_table_name();
    
    return $wpdb->get_var($wpdb->prepare("SELECT value FROM $table WHERE form_id = %d AND field_number = %d ORDER BY rand() LIMIT 1", $form_id, $field_number));
}

echo get_random_field_value(40, 3);

Initial URL
http://www.gravityhelp.com/forums/topic/random-form-value

Initial Description

                                

Initial Title
[Gravity Forms]Random form value

Initial Tags

                                

Initial Language
PHP