所以我有一个应用程序将卡和条形码编号保存到用户卡表中。
但首先,我只想保存 card_id
和 user_id
。
然后,我将在不同时间输入条形码和条形码_格式。
这是模拟:
我选择卡ID=1的卡 我的 ID 是 = 3
我的查询是:
INSERT INTO user_card (user_id, card_id) VALUES(?, ?)
user_card 表:
id card_id user_id barcode barcode_format
1 1 3
然后,在我选择的卡保存在表格中后,我将添加条形码。
问题是,最好的方法是什么?
可能吗?
谢谢:)
最佳答案
这是正确的方法,插入行,获取最后插入的id,通过最后插入的id更新行。阅读 this
关于PHP 查询 : How to input data into 2 columns column on the same table at different times,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27533137/