Nasıl bu güncelleştirme talimat basitleştirmek olabilir? Bir istemci bir öğe satın zaman o 1 ile satış güncelleyecektir.
$this->db->query('SELECT amount FROM shop_items WHERE itemid='.$itemid.'');
$new_amount = $item->amount+1;
if(!$this->db->query('UPDATE shop_items SET amount='.$new_amount.' WHERE itemid='.$itemid.'')):
return false;
endif;
Ben daha basit yapamazsınız böylece daha az hatları, örneğin vardır:
if(!$this->db->query('UPDATE shop_items SET amount=_current_value_+1 WHERE itemid='.$itemid.'')):
return false;
endif;
Bu mümkün mü? değil teşekkürler zaten eğer