【发布时间】:2015-10-04 17:22:34
【问题描述】:
我有这张表,其中包含来自数据库表“患者”的数据。
<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 添加为“就诊”表中的外键。
【问题讨论】:
标签: php mysql sql-server database laravel-5