Ok today's issue.. The model does not seem to recognize the primary key, column named "id"
$robot = new robot(); $robot->code = $unique_code; $robot->user_id = 0; $robot->agent_name = "name here"; $robot->date_created = date("Y-m-d H:i:s"); $robot->date_submitted = NULL; $robot->create() ; (also tried save())
error being returned We can't store robots right now: id is required
If I add in $robot->id = 1, it saved the first record
Then if I run with $robot->id = 1 again I get "SQLSTATE: Integrity constraint violation: 1062 Duplicate entry '1' for key 'PRIMARY'"
Confused at this point, my model is there "empty" in the class, just there for the reference
Table and model class were not names with "S" on the end robot vs robots