SQLSTATE[01000]: Warning: 1265 Data truncated for column ‘pay_totals’ at row 1
x
public function order(Request $req){
$order = new Order;
$order->pay_number = $req->checkout_number;
$order->pay_totals = $req->checkout_total;
$order->save();
return redirect(route('pay'))->with('message','Sending infomation successfully');
}
blade:
<input type="text" name="checkout_total" value="{{Cart::subTotal('0') }} ">
Helppp
Advertisement
Answer
The problem is that column pay_totals
can’t store whatever you are getting from the input because is too big.
Possibles solutions
SQL: ALTER TABLE [orders] ALTER COLUMN [pay_totals] VARCHAR(MAX)
MYSQL: ALTER TABLE [orders] MODIFY COLUMN [pay_totals] VARCHAR(60000)