title: Select column(s) names based on user entry with a MYSQL query
body: <p>Using PHP a secure user will enter a Ref (ex. NB093019) a query will be used to determine which PO(s) have that Ref and if they have any quantity. The issue is that we have 86 columns to check if that Ref is in and then once it finds what column it is in how to check the corresponding column that contains that quantity( the table cannot be edited).</p>
  
  <p>I can make this work with 86 if else statements in PHP and then more if else statements inside of each PHP statement. I have no launching point once i do the initial query.</p>
  
  <pre><code>select 'remainder'as prefix, po,  *comments,*GuideRef, *Qty
  from remainder 
  where  ('NB092419')IN (NWANTcomments,NWANTGuideRef,NWANTpreviouscomments,
                          NWANTpreviousGuideRef,NWANTprevious2comments,
                          NWANTprevious2GuideRef, BPrev2GuideRef, 
                          BPrev2comments, BPrevGuideRef, BPrevcomments, 
                          aGuideRef, Mcomments,MGuideRef,acomments,
                          MAGuideRef,BOGuideRef ) 
  group by po
  </code></pre>
  
  <p>I have removed some of the in() information so it is not so long also the *comments, *GuideRef, *Qty would be decided by which one of the columns in the IN() statement returns information. Is this even possible</p>