lundi 19 février 2018

Update fields if field already exists

I am trying to pull products from an API and store them locally onto my database.

An example of data returned is: SKU, Product Count, Product Total, QTY Remaining

I am wondering, how would i go about updating a row is a field is already existing.

For example: if it finds that the SKU already exists in the table, then to up date the following fields with the current loop: Product Count, Product Total, QTY Remaining

This is on a site built in laravel, so it uses Eloquent.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire