mercredi 27 février 2019

Get data from database with condition and show it in a view

This is the data that I have in database

This is what I want to make in the view.blade.php

What I want to do is I want to get the data from the database, if the data inside the column is 1, I want to get the column name as you can see in image 2, but there could be more than 1 column name because the column with data can be column A,B,C... etc.. and I want to show the student name and the subject (a,b,c... etc) if the data in it is '1' in the view. I stuck on how to get all those subject A,B,C.. this is the code that I have written, but it is incomplete because I don't know what to add on it to make it as what I have mentioned above. Hopefully, someone can help me. Thanks in advance

if($row->'A'=='1'){i dont know what should i put here so that i cant get the column name 'A' and print it in view.blade.php}



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2H1vuTH
via IFTTT

Aucun commentaire:

Enregistrer un commentaire