MM_Username insert into field
Hi everyone,
new to php and Mysql, moved over from ms access, i am creating a website to help people monitor there requests, they login with a login name and password like
login 'James Helliwell',
password ABCDEF1
i have a form so they enter there details in but i want it to insert the login name (MM_Username) into a filed called Account Manager
i think its the below code from my site that i need to modify, teaching myself so any help would be grealty appreciated
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form2")) {
$insertSQL = sprintf("INSERT INTO RequestsMaster (FieldSalesManager, AccountManager, AccountName, RequestMonth, `Module`, ModuleDescription, OrderQty, ApprovedByFSM, PotentialExtraBusiness, FinalApproval, ShippedStatus, ShippedDate) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['FieldSalesManager'], "text"),
GetSQLValueString($_POST['AccountManager'], "text"),
GetSQLValueString($_POST['AccountName'], "int"),
GetSQLValueString($_POST['RequestMonth'], "date"),
GetSQLValueString($_POST['Module'], "text"),
GetSQLValueString($_POST['ModuleDescription'], "text"),
GetSQLValueString($_POST['OrderQty'], "int"),
GetSQLValueString($_POST['ApprovedByFSM'], "int"),
GetSQLValueString($_POST['PotentialExtraBusiness'], "text"),
GetSQLValueString($_POST['FinalApproval'], "int"),
GetSQLValueString($_POST['ShippedStatus'], "text"),
GetSQLValueString($_POST['ShippedDate'], "date"));
mysql_select_db($database_DePuyConnection, $DePuyConnection);
$Result1 = mysql_query($insertSQL, $DePuyConnection) or die(mysql_error());
$insertGoTo = "Directory.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}