繁体   English   中英

从表中获取数据以插入到另一个数据库表

[英]Getting a data from a table to insert to another database table

我有此表,该表包含来自数据库表“病人”的数据。

在此处输入图片说明

 <td>
   <a href="{{ URL::to('/addvisit/'.$patient->pID) }}">
   <img src="images/visit.png" style="width:30px; height:30px;">
   </a>
 </td>

单击圆圈图标时,它将重定向到带有将插入数据库表“访问”中的表单的页面。

形式如下:

{!! Form::model($patient, ['url'=>'visit/' . $patient->pID, 'method' => 'PATCH']) !!}
            <div class="form-group">
                {!! Form::label('fname', 'Full Name',['class' => 'control-label'])!!}
                {!! Form::text('pName',null,['class' => 'form-control']) !!}

                {!! Form::label('address', 'Address',['class' => 'control-label'])!!}
                {!! Form::text('pAddress',null, ['class' => 'form-control']) !!}

                {!! Form::submit('SUBMIT',['class' => 'form-control btn btn-success']) !!}
            </div>
{!! Form::close() !!}

如何从“患者”表中添加患者ID,以将其设置为“访问”表中的外键。

通过控制器将其再次传递给带有表单的视图,并将其存储在隐藏的输入中

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM