insert, get ID of insert [FIXED: My fault] |
Tried:
PHP Code: $order_id = $orderModel->insert($data); Then tried: PHP Code: $orderModel->insert($data); Neither returned the inserted ID I don't understand why the first one wasn't built to return this information automatically - but whatever, why didn't the second one work? I did check the database, the record is inserted. I should get the ID of the inserted record, right? **************************** Fixed: First, make sure you're including all of the columns in the model declaration (left off order_id) and, also, don't make the wrong ID the key (also didn't have the right key for the table for the model). So, once those were fixed, it all worked fine. |
Messages In This Thread |
insert, get ID of insert [FIXED: My fault] - by Kaosweaver - 04-13-2020, 08:26 AM
RE: insert, get ID of insert [FIXED: My fault] - by cyberstunts - 04-13-2020, 04:06 PM
RE: insert, get ID of insert [FIXED: My fault] - by Kaosweaver - 04-14-2020, 04:47 AM
RE: insert, get ID of insert [FIXED: My fault] - by cyberstunts - 04-14-2020, 04:51 AM
|