Combining two fields to make a third then insert into DB
I have this script:
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form")) {
$insertSQL = sprintf("INSERT INTO members (Firstname, Surname, `Section`, Login, Password, DefaultPassword, Email) VALUES (%s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['Firstname'], "text"),
GetSQLValueString($_POST['Surname'], "text"),
GetSQLValueString($_POST['Section'], "text"),
GetSQLValueString($_POST['Login'], "text"),
GetSQLValueString($_POST['Password'], "text"),
GetSQLValueString($_POST['DefaultPassword'], "text"),
GetSQLValueString($_POST['Email'], "text"));
But I want to the value for the Login to be the Firstname + Surname all in lowercase.
I have tried this, but it doesn't work...
$Login = strtolower($_POST['Firstname'] . $_POST['Surname']);
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form")) {
$insertSQL = sprintf("INSERT INTO members (Firstname, Surname, `Section`, Login, Password, DefaultPassword, Email) VALUES (%s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['Firstname'], "text"),
GetSQLValueString($_POST['Surname'], "text"),
GetSQLValueString($_POST['Section'], "text"),
$Login, "text",
GetSQLValueString($_POST['Password'], "text"),
GetSQLValueString($_POST['DefaultPassword'], "text"),
GetSQLValueString($_POST['Email'], "text"));
Any ideas what I am doing wrong?
