我正在尝试使用CodeIgniter将递归数据插入MYSQL。但是插入func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "ChromazonColorCell", for: indexPath) as! ChromazonColorCell
cell.configureData(data: colorSource[indexPath.row])
cell.cellColorButton.tag = indexPath.row
if color == colorSource[indexPath.row] {
cell.cellColorButton.layer.cornerRadius = 5.0
cell.cellColorButton.clipsToBounds = true
cell.cellColorButton.layer.borderWidth = 2
cell.cellColorButton.layer.borderColor = UIColor.black.cgColor
}
else{
cell.cellColorButton.layer.cornerRadius = 5.0
cell.cellColorButton.clipsToBounds = true
cell.cellColorButton.layer.borderWidth = 0
cell.cellColorButton.layer.borderColor = UIColor.clear.cgColor
}
return cell
}
不能完全正常工作。仅插入上次创建的自动增量ID为parent_id
。我被卡住了,如何完全插入?
应该是这样的-> https://imgur.com/r2o8shI
但是现在-> https://imgur.com/EnZetJJ
插入代码:
parent_id