--- webform_submissions.inc
+++ webform_submissions.inc
@@ -266,11 +266,11 @@
   // Retrieve submission data for this IP address or username from the database.
   $query = 'SELECT count(*) '.
            'FROM {webform_submissions} '.
-           "WHERE (( 0 = %d AND remote_addr = '%s') OR (uid > 0 AND uid = %d)) ".
+           "WHERE (( 0 = %d AND uid = %d AND remote_addr = '%s') OR (uid > 0 AND uid = %d)) ".
            'AND submitted > %d AND nid = %d';
 
   // Fetch all the entries from the database within the submit interval with this username and IP.
-  $num_submissions_database = db_result(db_query($query, $user->uid, ip_address(), $user->uid, ($node->webform['submit_interval'] != -1) ? (time() - $node->webform['submit_interval']) : $node->webform['submit_interval'], $node->nid));
+  $num_submissions_database = db_result(db_query($query, $user->uid, $user->uid, ip_address(), $user->uid, ($node->webform['submit_interval'] != -1) ? (time() - $node->webform['submit_interval']) : $node->webform['submit_interval'], $node->nid));
 
   // Double check the submission history from the users machine using cookies.
   $num_submissions_cookie = 0;
