Quote:
Originally Posted by sarettah
Without knowing more about the table you are inserting into, it is hard to say. Could be duplicate entry on a unique index, not sure. Also not sure what level you are reporting errors. When I am in development mode I have all error reporting php and mysql turned on so I can see anything that goes wrong. I also put message s in the code so I can see exactly what is happening and when.
However, in what you posted, if it is the code that you are running there is a space in '$status' that should not be there, but that should blow it off every time not just on subsequent runs.
|
Yeah, I dont see an "ID" field in the insert code.
The DB is set to "auto index"; but he has
no field defined for the auto index.
// Insert user data into table
$result = mysqli_query($mysqli, "INSERT INTO DomainManagement(Registrar,DomainName,Registration ,Expiration,NameServer1,NameServer2,Status,Notes) VALUES('$Registrar','$DomainName','$Registration', '$Expiration','$NameServer1','$NameServer2','$Stat us','$Notes')");
The SQL table should have a record ID field. (You can do anything you want but ID is standard)
The ID will be "" in the data fields so that SQL will create the ID number on insert for you.
The code should look like this, I think.
// Insert user data into table
$result = mysqli_query($mysqli, "INSERT INTO DomainManagement(
ID,Registrar,DomainName,Registration ,Expiration,NameServer1,NameServer2,Status,Notes) VALUES(
"", '$Registrar','$DomainName','$Registration', '$Expiration','$NameServer1','$NameServer2','$Stat us','$Notes')");
