【问题标题】:Getting a data from a table to insert to another database table从表中获取数据以插入到另一个数据库表中
【发布时间】: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


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-31
      • 1970-01-01
      相关资源
      最近更新 更多