'Fatal error: Uncaught TypeError: Unsupported operand types: string + string [duplicate]
<?php
include "connection.php";
$rand = rand(100000, 999999);
$signup_employee_id = 'GTE' + (string)$rand;
$signup_firstname = $_POST['signup_firstname'];
$signup_middlename = $_POST['signup_middlename'];
$signup_lastname = $_POST['signup_lastname'];
$signup_address = $_POST['signup_address'];
$signup_contactnumber = $_POST['signup_contactnumber'];
$signup_birthdate = $_POST['signup_firstname'];
$signup_age = $_POST['signup_age'];
$signup_email = $_POST['signup_email'];
$signup_username = $_POST['signup_username'];
$signup_password = md5($_POST['signup_password']);
$signup_confirm_password = md5($_POST['signup_confirm_password']);
$signup_command = "INSERT INTO Employee_Table VALUES ('$signup_employee_id','$signup_firstname','$signup_middlename', '$signup_lastname','$signup_address','$signup_age','$signup_birthdate','$signup_email','$signup_contactnumber')";
if($signup_password == $signup_confirm_password){
if ($conn->query($signup_command) === TRUE) {
$signup_command_2 = "INSERT INTO Employee_Account_Table VALUES ('$signup_employee_id','$signup_username','$signup_password','Cashier')";
if ($conn->query($signup_command_2) === TRUE) {
echo "New record created successfully";
}
} else {
echo "Error: " . $signup_command . "<br>" . $conn->error;
}
}
?>
what is the problem in this, I always got this error message
Fatal error: Uncaught TypeError: Unsupported operand types: string + string in C:\xampp\htdocs\webpage\submit-signup.php:4 Stack trace: #0 {main} thrown in C:\xampp\htdocs\webpage\submit-signup.php on line 4
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
