Hi all - I'm attempting to build a form for work, using the following code: <?php function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue; switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } $editFormAction = $HTTP_SERVER_VARS['PHP_SELF']; if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { $editFormAction .= "?" . $HTTP_SERVER_VARS['QUERY_STRING']; } if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "changes")) { $insertSQL = sprintf("INSERT INTO flight_ops_crj_sys_manual (duty_title, acknow_of, manual_number, personnel, personnel_tba, completion_time, comments) VALUES (%s, %s, %s, %s, %s, %s, %s)", GetSQLValueString($HTTP_POST_VARS['duty'], "text"), GetSQLValueString($HTTP_POST_VARS['akno'], "text"), GetSQLValueString($HTTP_POST_VARS['manualnum'], "int"), GetSQLValueString($HTTP_POST_VARS['personnel'], "int"), GetSQLValueString($HTTP_POST_VARS['personneltba'], "int"), GetSQLValueString($HTTP_POST_VARS['completetime'], "text"), GetSQLValueString($HTTP_POST_VARS['comments'], "text")); mysql_select_db($database_acknowledge, $acknowledge); $Result1 = mysql_query($insertSQL, $acknowledge) or die(mysql_error()); $insertGoTo = "/forms/change_acknowledgement_complete.php"; if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $HTTP_SERVER_VARS['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo)); } ?> [b]I'm using a basic DMX insert record behavior, which Ive used several times in the past without errors, so I'm a little perplexed. The action for my form's[/b] action="<?php echo $editFormAction; ?>" [b]and the error message I receive upon submission of the form is:[/b] Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource - for both lines 49 & 50 of the script. [b]Lines 49 and 50 of the script are:[/b] mysql_select_db($database_acknowledge, $acknowledge); $Result1 = mysql_query($insertSQL, $acknowledge) or die(mysql_error()); I'd thoroughly appreciate any insight possible. I'm all about learning something new, so I'd love for someone to break it down for me b/c I'm at my wit's end. Thanks for your time, and I look forward to hearing from you.