« Auto-notification of file download | Main | Karmic Repository Gone »
November 29, 2011
Query for Webform Submissions - Snippets
$ip = '::1';// execute sql using db_query
$sid_sql = db_query("SELECT n.sid FROM drupal_webform_submissions n WHERE n.remote_addr = '%s' ", $ip);
// fetch database results in an array
$results = array();
while ($row = db_fetch_array($sid_sql)) $results[] = $row;//get last sid as an array $last_sid["sid"]
$last_sid = end($results);// query to retrieve submitted webform data
$webform_sql = db_query("SELECT data FROM drupal_webform_submitted_data n WHERE n.sid = '%s' ", $last_sid["sid"]);// fetch database results in an array
$webform_submission = array();
while ($row = db_fetch_array($webform_sql)) $webform_submission[] = $row;/*put $webform_submission information into message body*/
Notes:
Another option is to use a webform hook but this returns all of the submissions:
module_load_include('inc', 'webform', 'webform_submissions');
$values = webform_get_submissions($nid, null, $user->uid, 1);
Posted by kkwaiser at November 29, 2011 03:15 PM
Trackback Pings
TrackBack URL for this entry:
http://mblog.lib.umich.edu/mt-bin/mt-tb.cgi/2309
Listed below are links to weblogs that reference Query for Webform Submissions - Snippets:
» Cheap Jerseys from Cheap Jerseys
It's simple to see why Al Kaline must be described when you speak about the greatest all around players in the history of the Significant Leagues. [Read More]
Tracked on May 18, 2013 08:42 PM
» cheap designer bags from cheap designer bags
Data Discussions: Query for Webform Submissions - Snippets replica designer handbags [Read More]
Tracked on May 21, 2013 07:52 PM
» nIQhDQbm from nIQhDQbm
Data Discussions: Query for Webform Submissions - Snippets [Read More]
Tracked on May 21, 2013 07:55 PM
» wCvjJLZs from wCvjJLZs
Data Discussions: Query for Webform Submissions - Snippets [Read More]
Tracked on May 21, 2013 07:55 PM
» Cheap Red Wings Jerseys from Cheap Red Wings Jerseys
Possibly the best quote that you could ever get from a ball player came from arguable the most effective hitter ever to play the game of baseball. The Splendid Splinter once said about Kaline, "There is a hitter. In my book he's the greatest correct-ha... [Read More]
Tracked on May 24, 2013 06:36 AM