I have an Sql database with about 20 fields in the record. I want to create new records by only adding the values of two of these fields. So I have the following code:
CODE: SELECT ALL
$sql = "INSERT INTO Customer SET Email = '$Email', Accesscode = '$Code' "; $result = mysqli_query($conn, $sql); if (!$sql) echo "Error 1002: Connection failed. Try later."; else echo "Success"; mysqli_close($Conn);
I have also tried with this:
CODE: SELECT ALL
$sql = "INSERT INTO Customer (Email, Accesscode) VALUES ('$Email', '$Accesscode') ";
Both of this gives the echo "Success" message, but no record enters into the table. I have also checked that the $Email and $Accesscode variables are not empty.
Thanks in advance
Sincerely
06-27-2020 07:02 AM
@jrjong wrote:I have an Sql database with about 20 fields in the record. I want to create new records by only adding the values of two of these fields. So I have the following code:
CODE: SELECT ALL
$sql = "INSERT INTO Customer SET Email = '$Email', Accesscode = '$Code' "; $result = mysqli_query($conn, $sql); if (!$sql) echo "Error 1002: Connection failed. Try later."; else echo "Success"; mysqli_close($Conn);I have also tried with this:
CODE: SELECT ALL
$sql = "INSERT INTO Customer (Email, Accesscode) VALUES ('$Email', '$Accesscode') roadrunner email";Both of this gives the echo "Success" message, but no record enters into the table. I have also checked that the $Email and $Accesscode variables are not empty.
Thanks in advance
Sincerely
Anyone?
07-08-2020 09:05 PM