0
$visitorphonenumber=DB::select('select phonenumber from visitortable where email=?',[Auth::user()->email]);
$booking=new bookingmodel();
$booking->visitorphonenumber=$visitorphonenumber;
该商店,如数据库[{"phonenumber":"9874589608"}]
的价值,但我想只存储9874589608
Laravel数据库中存储唯一的价值不是阵列
[{“phonenumber”:“9874589608”}]实际上是为我的代码打印的.. 当我第一次使用它存储{“phonenumber”:“9874589608”}这是没有框大括号 – Nivas
现在是它的solve.when我们使用get函数我们无法访问dataelements,如果我们访问和存储它将存储为我描述。我们使用first()函数来访问数据元素。 – Nivas