Open CherukuriSiva opened 3 years ago
I want to update one Cell in the row, by multiplying some other 2 cells like below.
UPDATE yourTable yt SET yt.Total = (yt.Pieces * yt.Price)
I tried below code:
` $last_id = $this->db->rawQuery('UPDATE bet_users_info bui SET bui.profit_amount = (bui.bet_amount * bui.cashout) where bui.betid = ?', 2);`
But I am receiving the error Undefined offset: 1 in \vendor\thingengineer\mysqli-database-class\MysqliDb.php on line 2056
Undefined offset: 1 in \vendor\thingengineer\mysqli-database-class\MysqliDb.php on line 2056
I have no idea how to achieve this without Raw Query:
` $update_profits_data = array( "profit_amount" => $bet_info_row["bet_amount"] * $bet_info_row["cashout"], ); $this->db->where('betid', $bet_info_row["id"]); $last_id = $this->db->update('bet_users_info', $update_profits_data); ` ```Kindly let me know how to proceed further.
I want to update one Cell in the row, by multiplying some other 2 cells like below.
UPDATE yourTable yt SET yt.Total = (yt.Pieces * yt.Price)
I tried below code:
But I am receiving the error
Undefined offset: 1 in \vendor\thingengineer\mysqli-database-class\MysqliDb.php on line 2056
I have no idea how to achieve this without Raw Query: