Post from Query

  • jordonshaw
  • Student
  • Student
  • User avatar
  • Posts: 96
  • Loc: Tennessee

Post 3+ Months Ago

Ok, so I've got myself lost on what I need to do here and I'm reaching out for help. I have two while loops, one that generates a list of courses and then one that generate a list of units for those courses. On my units I have an input box. I don't know how to update the table based on which input box was filled out for the class and what unit of the class. I'm pretty sure that I would use an array, but I'm just lost at this point. Please help.

Code: [ Select ]
  <?php
    $course_set1 = mssql_query("SELECT crs_id, crs_name, crs_author FROM SNP_crs where pro_id = '{$program}'", $connection);
    while ($course1 = mssql_fetch_array($course_set1)){
      echo "
      <tr>
      <td colspan=\"16\">{$course1['crs_name']} - {$course1['crs_author']}</td></tr>
      <tr>
      <td>Unit</td><td>Unit Title</td><td>Record Date</td><td>Edit A/V</td>
      <td>Send for Transcript</td><td>Rec'd Transcript</td><td>Mapped</td>
      <td>Designer</td><td>QC Check</td><td>Bounced</td><td>Published</td>
      <td>QC Check</td><td>Read</td><td>Attend</td><td>Complete</td><td>Discuss</td>
      </tr>";
   
    $course_set = mssql_query("SELECT * FROM SNP_crsunits WHERE crs_id = '{$course1['crs_id']}'", $connection);
    while ($course = mssql_fetch_array($course_set)) {     
      echo "
      <tr>
      <td>{$course['unit']}</td>
      <td>&nbsp;<input type=\"text\" name=\"unit\" value=\"{$course['unit_title']}\" /></td>
      <td>&nbsp;</td>      
      <td>&nbsp;" . str_replace("1", "X", ($course['edit_av'])) . " </td>
      <td>&nbsp;" . str_replace("1", "X", ($course['sd_transc'])) . "</td>
      <td>&nbsp;" . str_replace("1", "X", ($course['rd_transc'])) . "</td>
      <td>&nbsp;" . str_replace("1", "X", ($course['mapped'])) . "</td>
      <td>&nbsp;" . str_replace("1", "X", ($course['designer'])) . "</td>
      <td>&nbsp;" . str_replace("1", "X", ($course['qc_check'])) . "</td>
      <td>&nbsp;" . str_replace("1", "X", ($course['bounced'])) . "</td>
      <td>&nbsp;" . str_replace("1", "X", ($course['published'])) . "</td>
      <td>&nbsp;" . str_replace("1", "X", ($course['qc_check2'])) . "</td>
      <td>&nbsp;" . str_replace("1", "X", ($course['read'])) . "</td>
      <td>&nbsp;" . str_replace("1", "X", ($course['attend'])) . "</td>
      <td>&nbsp;" . str_replace("1", "X", ($course['complete'])) . "</td>
      <td>&nbsp;" . str_replace("1", "X", ($course['discuss'])) . "</td>
      </tr>
      ";
    } echo "<tr><td colspan=\"16\">&nbsp;</td></tr>";
    };    
?>
  1.   <?php
  2.     $course_set1 = mssql_query("SELECT crs_id, crs_name, crs_author FROM SNP_crs where pro_id = '{$program}'", $connection);
  3.     while ($course1 = mssql_fetch_array($course_set1)){
  4.       echo "
  5.       <tr>
  6.       <td colspan=\"16\">{$course1['crs_name']} - {$course1['crs_author']}</td></tr>
  7.       <tr>
  8.       <td>Unit</td><td>Unit Title</td><td>Record Date</td><td>Edit A/V</td>
  9.       <td>Send for Transcript</td><td>Rec'd Transcript</td><td>Mapped</td>
  10.       <td>Designer</td><td>QC Check</td><td>Bounced</td><td>Published</td>
  11.       <td>QC Check</td><td>Read</td><td>Attend</td><td>Complete</td><td>Discuss</td>
  12.       </tr>";
  13.    
  14.     $course_set = mssql_query("SELECT * FROM SNP_crsunits WHERE crs_id = '{$course1['crs_id']}'", $connection);
  15.     while ($course = mssql_fetch_array($course_set)) {     
  16.       echo "
  17.       <tr>
  18.       <td>{$course['unit']}</td>
  19.       <td>&nbsp;<input type=\"text\" name=\"unit\" value=\"{$course['unit_title']}\" /></td>
  20.       <td>&nbsp;</td>      
  21.       <td>&nbsp;" . str_replace("1", "X", ($course['edit_av'])) . " </td>
  22.       <td>&nbsp;" . str_replace("1", "X", ($course['sd_transc'])) . "</td>
  23.       <td>&nbsp;" . str_replace("1", "X", ($course['rd_transc'])) . "</td>
  24.       <td>&nbsp;" . str_replace("1", "X", ($course['mapped'])) . "</td>
  25.       <td>&nbsp;" . str_replace("1", "X", ($course['designer'])) . "</td>
  26.       <td>&nbsp;" . str_replace("1", "X", ($course['qc_check'])) . "</td>
  27.       <td>&nbsp;" . str_replace("1", "X", ($course['bounced'])) . "</td>
  28.       <td>&nbsp;" . str_replace("1", "X", ($course['published'])) . "</td>
  29.       <td>&nbsp;" . str_replace("1", "X", ($course['qc_check2'])) . "</td>
  30.       <td>&nbsp;" . str_replace("1", "X", ($course['read'])) . "</td>
  31.       <td>&nbsp;" . str_replace("1", "X", ($course['attend'])) . "</td>
  32.       <td>&nbsp;" . str_replace("1", "X", ($course['complete'])) . "</td>
  33.       <td>&nbsp;" . str_replace("1", "X", ($course['discuss'])) . "</td>
  34.       </tr>
  35.       ";
  36.     } echo "<tr><td colspan=\"16\">&nbsp;</td></tr>";
  37.     };    
  38. ?>


Thank you in advance!

Jordon
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • jordonshaw
  • Student
  • Student
  • User avatar
  • Posts: 96
  • Loc: Tennessee

Post 3+ Months Ago

Any ideas?
  • jordonshaw
  • Student
  • Student
  • User avatar
  • Posts: 96
  • Loc: Tennessee

Post 3+ Months Ago

Bump

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: spork and 54 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.