First post here - I've been learning php and mysql for a month or so now.
I'm trying to post the session 'MM_Username' into log notes. so it reads 'archived by username'
I thought that if I set the lognote value to 'archived by " . $_SESSION['MM_Username'] . "' I would get the result i was after. Apparently not.
What am I doing wrong? My code is below.
Thanks
if ((isset($_GET['divisionid'])) && ($_GET['divisionid'] != "")) {
$logarchiveSQL = sprintf("INSERT INTO log (logaction, logdivisionid, lognotes) VALUES ('Division Archived', %s, 'archived by " . $_SESSION['MM_Username'] . "')",
GetSQLValueString($_GET['divisionid'], "int"));
mysql_select_db($database_connect, $connect);
$Result2 = mysql_query($logarchiveSQL, $connect) or die(mysql_error());
$updateGoTo = "../divisions.php";
if (isset($_SERVER['QUERY_STRING'])) {
$updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
$updateGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $updateGoTo));}