jeudi 18 juillet 2019

Wrong output in query

i have problem with one query. They give me wrong output of cell. Insead column of "id method" ,they put me column "name"? what i'm doing wrong? thanks!

controller

$task = Task::find($id);
$samples = Sample::find($id);

$methods = DB::table('methods')
         ->join('analysis','methods.method','=','analysis.id')
         ->join('technicians','methods.name','=','technicians.id')
         ->where('methods.task_id','=',$url)
         ->orderBy('methods.id', 'ASC')
         ->get();

and this is in view

foreach($methods as $method)

<tr>
    <td></td>
    <td></td>
    <td style="text-align:center"></td>
    <td>
        <a href="//edit" class="btn btn-default center-block">Uredi</a>
    </td>
  </tr>
    @endforeach
</table>```



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire