--- typo3conf/ext/th_mailformplus/pi1/class.tx_thmailformplus_pi1_orig.php	2007-08-13 20:25:52.252432073 +0000
+++ typo3conf/ext/th_mailformplus/pi1/class.tx_thmailformplus_pi1.php	2007-08-13 20:31:34.616676301 +0000
@@ -170,13 +170,24 @@
 			    }
 			    
           		// Initializing the query parameters:
-			    $query = "SELECT tx_thmailformplus_main.* FROM tx_thmailformplus_main WHERE pid IN (".$mailformplus_id.") LIMIT 0,1";
-			    $res = $GLOBALS['TYPO3_DB']->sql(TYPO3_db, $query); 
-			    if (mysql_error()) {
-			   		debug(array(mysql_error(),$query));
-			   	}
+#			    $query = "SELECT tx_thmailformplus_main.* FROM tx_thmailformplus_main WHERE pid IN (".$mailformplus_id.") LIMIT 0,1";
+#			    $res = $GLOBALS['TYPO3_DB']->sql(TYPO3_db, $query); 
+#			    if (mysql_error()) {
+#			   		debug(array(mysql_error(),$query));
+#			   	}
 			    $this->internal["currentTable"] = "tx_thmailformplus_main";
-			    $this->internal["currentRow"] = mysql_fetch_array($res);
+#			    $this->internal["currentRow"] = mysql_fetch_array($res);
+
+					$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
+						'*',
+						$this->internal["currentTable"],
+						'pid IN (".$mailformplus_id.")',
+						'',
+						'',
+						'0,1');
+
+			    $this->internal["currentRow"] = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
+
 			    
 			    #############
 			    # template
@@ -3759,4 +3770,4 @@
 	include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/th_mailformplus/pi1/class.tx_thmailformplus_pi1.php"]);
 }
 
-?>
\ No newline at end of file
+?>
