Copy link to clipboard
Copied
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?
Your login line should be:
GetSQLValueString($Login, "text"),
There is only one statement there and you wrote "$Login, "text") which is actually 2 statements. The ( ) around the $Login text executes it as one statement like the DW code is looking for.
Outside of that it should work.
Copy link to clipboard
Copied
Your login line should be:
GetSQLValueString($Login, "text"),
There is only one statement there and you wrote "$Login, "text") which is actually 2 statements. The ( ) around the $Login text executes it as one statement like the DW code is looking for.
Outside of that it should work.
Copy link to clipboard
Copied
Perfect thanks!