title: Get data from database with condition and show it in a view
body: <p><a href="https://i.stack.imgur.com/ukCST.jpg" rel="nofollow noreferrer">This is the data that I have in database</a></p>
  
  <p><a href="https://i.stack.imgur.com/4f4fA.jpg" rel="nofollow noreferrer">This is what I want to make in the view.blade.php</a></p>
  
  <p>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</p>
  
  <pre><code>if($row-&gt;'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}
  </code></pre>