Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/62.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 单击下一步和上一步按钮以javascripct显示另一个问题_Php_Mysql_Laravel - Fatal编程技术网

Php 单击下一步和上一步按钮以javascripct显示另一个问题

Php 单击下一步和上一步按钮以javascripct显示另一个问题,php,mysql,laravel,Php,Mysql,Laravel,我没有得到这个获取的值,foreach不能正常工作,错误显示在@foreach中 视图刀片 <div class="question" id="question-div"> <form action="{{ url('') }}" method="POST" id="question-form"> {{ c

我没有得到这个获取的值,foreach不能正常工作,错误显示在@foreach中

视图刀片

<div class="question" id="question-div">
 <form action="{{ url('') }}" method="POST" id="question-form">
                                 {{ csrf_field() }}
                    <?php 
                      $count=0;
                     ;?>
              @foreach($examdata as $equestionType)                 
                  @foreach($equestionType as $key => $equestion)

                      <p>{{ $equestion->questions }}</p>
                      <input type="hidden" id="question_id[{{$count}}]" name="question_id[{{$count}}]" value="{{ $equestion->id }}">
                      <label class="radio-inline">
                         <input type="radio" required name="en_answer[{{$count}}]" value="{{ $equestion->option_a }}">{{ $equestion->option_a }}
                      </label>
                      <label class="radio-inline">
                         <input type="radio" required name="en_answer[{{$count}}]" value="{{ $equestion->option_b}}">{{ $equestion->option_b }}
                      </label>
                      <label class="radio-inline">
                         <input type="radio" required name="en_answer[{{$count}}]" value="{{ $equestion->option_c}}">{{ $equestion->option_c }}
                      </label>
                      <label class="radio-inline">
                         <input type="radio" required name="en_answer[{{$count}}]" value="{{ $equestion->option_d}}">{{ $equestion->option_d }}
                      </label>
                       <hr>
                   <?php $count++; ?>

                @endforeach
            @endforeach

        <button type="submit" id="submit" class="btn btn-primary btn-sm pull-right">Submit</button>
        <div class='button' id='next'><a href='#'>Next</a></div>
        <div class='button' id='prev'><a href='#'>Prev</a></div>
   </form>

}

欢迎来到Stack OF!为了让我们提供帮助,请提供问题的更多细节。例如,您在哪一行得到错误,错误到底是什么。
<?php
   $data = Question::select('*')->get();
        return view("frontend.exam", [
        'examdata' => $data,
    ]);
}

/**
 * Show the form for creating a new resource.
 *
 * @return \Illuminate\Http\Response
 */
public function create()
{
    //
   
}

/**
 * Store a newly created resource in storage.
 *
 * @param  \Illuminate\Http\Request  $request
 * @return \Illuminate\Http\Response
 */
public function store(Request $request)
{
    
    
    
    
        
   

}

/**
 * Display the specified resource.
 *
 * @param  int  $id
 * @return \Illuminate\Http\Response
 */
public function show($id)
{
    //
   
}

/**
 * Show the form for editing the specified resource.
 *
 * @param  int  $id
 * @return \Illuminate\Http\Response
 */
public function edit($id)
{
   
}

/**
 * Update the specified resource in storage.
 *
 * @param  \Illuminate\Http\Request  $request
 * @param  int  $id
 * @return \Illuminate\Http\Response
 */
public function update(Request $request, $id)
{

    
}

/**
 * Remove the specified resource from storage.
 *
 * @param  int  $id
 * @return \Illuminate\Http\Response
 */
public function destroy($id)
{
   
}