Jump to content

LHC

Members
  • Posts

    1
  • Joined

  • Last visited

Everything posted by LHC

  1. LHC

    PHP and MySQL Query

    Hi All, Wondering if someone can point me in the right direction. Currently I have a table with several columns with names such as A1, A2, A3 etc and I've found that doing it this way no longer works with the new database structure I want to use. The A1, A2, A3.. will now be listed within the actual column. I have included the current code I am, using to get this information, but I don't know how to loop through the column there the A1, A2.. are and get the information on the same row. $i=1; $row = mysqli_fetch_assoc($result); while ($i < 6) { if($row["MON".$i.""]=='FREE') { print " Available"; } else { if($row["MON$i"]==$logon_name) { echo $i; print"".$row["MON". $i. ""]; print " ". $row["MONCLASS".$i.""]; print " Cancel"; print ""; } else { print"".$row["MON". $i. ""]; print " ". $row["MONCLASS$i"]; print ""; } } $i++;}} ?> Any pointers would be great. Luke
×
×
  • Create New...