Alter Abfrage wie diesemysql: Aktualisierung bestehenden Spalt des Spaltenwert in vorbereiteter Abfrage mit
update tbl_order set `pack_id` =0, `pack_down_count`=pack_down_count + '".intval($_POST['item_number'])."',`price`='".$_POST['mc_gross']."', `otime`=Now(), `ptime`=Now(), status='paid', pack_download=pack_download + '".intval($_POST['item_number'])."' where member_id='".$_MYVAR['userid']."'"
war mochte ich es bereit statment zu ändern, ich bin mit einer Klasse von https://github.com/joshcam/PHP-MySQLi-Database-Class
für
Aktualisierungänderte ich die obige Abfrage zu
$data = array(
'pack_id' =>$_MYVAR['pack_id'],
'pack_apply_count' =>`pack_apply_count` + intval($_POST['item_number']),
'price' =>$_POST['mc_gross'],
'otime' =>date('Y-m-d H:i:s'),
'ptime' =>date('Y-m-d H:i:s'),
'status' =>'paid',
'pack_apply' =>`pack_apply` + intval($_POST['item_number'])
);
$db->where('member_id',$_MYVAR['userid']);
$db->update("tbl_order",$data);
auch tri ed ohne Backticks um pack_apply_count und pack_apply aber mein Tisch
nicht $data = array(
'pack_id' =>$_MYVAR['pack_id'],
'pack_apply_count' =>pack_apply_count + intval($_POST['item_number']),
'price' =>$_POST['mc_gross'],
'otime' =>date('Y-m-d H:i:s'),
'ptime' =>date('Y-m-d H:i:s'),
'status' =>'paid',
'pack_apply' =>pack_apply + intval($_POST['item_number'])
);
$db->where('member_id',$_MYVAR['userid']);
$db->update("tbl_order",$data);
Bitte sagen Sie richtigen Weg, um die Tabelle
Antwort: $ db-> inc (pack_apply) und db- $> inc (pack_apply_count) –