/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?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);
URL: http://www.gravityhelp.com/forums/topic/random-form-value