There is a problem signing you up. You have an error in your SQL syntax;
check the manual that corresponds to your MariaDB server version for the right syntax to use near 'way', 'ENGLAND', 'sn66er', 'Home Owner', '6months', '1793321653', '', 'state', '' at line 1
Hello, new to PHP and am struggling with the code as everything I try to run, I get this error. Please, what am I missing? I have checked the other related questions and tried everything without success:
$query = "INSERT INTO users (Title, username, password, marital_status,
dependents, name, lastname, email, loan_purpose, employment_status,
employer_name, work_address, work_region, work_postcode, work_mobile,
employment_type, time_employer, payment_frequency, wages_paid_into_account,
othermonthly_income, rent_mortgages, creditcards_loans,
othermonthly_expenses, account_name, bank_name, account_no, sortcode,
yearswith_bank, heard_about_us, address, region, postcode, residential_type,
time_address, mobile, landline, county, birthdate, income, nextpaydate, Loanamount, Terms, Monthlyrepayment, Totalrepayment, Interest, gender)
VALUES ('$title', '$username', '$password', '$maritalstatus', '$dependant',
'$name', '$lastname', '$email', '$loanPurpose', '$employmentStatus',
'$employerName', '$employerAddress', '$employerRegion', '$workpostcode',
'$workphone', '$employmentType', '$employmentLength', '$paymentFrequency',
'$howYouGetPaid', '$otherIncome', '$rent_mortgage',
'$creditCard_loansExpenses', '$otherMonthlyExpenses', '$accountName',
'$bankName', '$accountNumber', '$sortCode', '$accountLength',
'$hearAboutUs', $address', '$region', '$postcode', '$tenancyType',
'$timeatAddress', '$mobilenumber', '$landline', '$county', '$birth',
'$income', '$nextPay', '$loanamount', '$terms', '$monthlyrepayment',
'$totalrepayment', '$interest', '$gender')";
if (mysqli_query($connection, $query)){
$_SESSION["username"] =$username;
echo " Successfully logged in";
header("location: login.php");
}
//create a variable to see if it went through
// $result = mysqli_query($connection, $query ); // assign variable
else{
die("<p> There is a problem signing you up.</p>" . mysqli_error($connection));
}