Page 1 of 1

do/while statement not working properly

Posted: Mon Jul 15, 2002 9:45 am
by fariquzeli
I have 36 records in a database, some of the records are blank because they aren't required fields in my form, so i want those to show as well as the 5 or 6 cells that actually contain data. The problem is only one field is showing, and its the first field with data in it. The rest of the fields don't show at all, not the blank ones or the ones containing data after it, here is the code:

Code: Select all

<td><?php do &#123; ?>
              <font size="1" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $row_miscellaneous&#1111;'suggestions']; ?></font> 
              <?php &#125; while ($row_miscellaneous = mysql_fetch_assoc($miscellaneous)); ?></td>
its code pre-programmed by dreamweaver MX. I have 3 other tables with the same format that all print out just fine. It seems to be this one that's giving me trouble.

Posted: Mon Jul 15, 2002 10:24 am
by mikeq
Based on the code you put here

$row_miscellaneous['suggestions']

This is only outputing the 'suggestions' field, there would need to be similar code for the other fields

$row_miscellaneous['myotherfield']...etc

Mike

Posted: Mon Jul 15, 2002 10:55 am
by fariquzeli
there are no other fields in that table. It's the only one yet it only is echoing out one row and not the others with content in them.

Posted: Mon Jul 15, 2002 11:29 am
by fariquzeli
here is the php for the echoed out table sitting right next to the above

Code: Select all

<?php do &#123; ?>
          <tr> 
            <td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $row_curriculum&#1111;'polishing_philosophy']; ?></font></td>
            <td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $row_curriculum&#1111;'teaching_year']; ?></font></td>
            <td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $row_curriculum&#1111;'teaching_year_semester']; ?></font></td>
            <td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $row_curriculum&#1111;'polishing_procedure']; ?></font></td>
            <td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $row_curriculum&#1111;'ergonomics_taught']; ?></font></td>
            <td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $row_curriculum&#1111;'seperate_course']; ?></font></td>
            <td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $row_curriculum&#1111;'hours_received']; ?></font></td>
            <td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $row_curriculum&#1111;'teaching_importance']; ?></font></td>
            <td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $row_curriculum&#1111;'prepared_module']; ?></font></td>
            <td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $row_curriculum&#1111;'a_fall']; ?></font></td>
            <td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $row_curriculum&#1111;'b_fall']; ?></font></td>
            <td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $row_curriculum&#1111;'c_fall']; ?></font></td>
            <td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $row_curriculum&#1111;'d_fall']; ?></font></td>
            <td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $row_curriculum&#1111;'a_spring']; ?></font></td>
            <td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $row_curriculum&#1111;'b_spring']; ?></font></td>
            <td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $row_curriculum&#1111;'c_spring']; ?></font></td>
            <td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $row_curriculum&#1111;'d_spring']; ?>&nbsp;</font></td>
            <td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $row_curriculum&#1111;'a_summer']; ?></font></td>
            <td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $row_curriculum&#1111;'b_summer']; ?></font></td>
            <td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $row_curriculum&#1111;'c_summer']; ?></font></td>
            <td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $row_curriculum&#1111;'d_summer']; ?></font></td>
            <td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $row_curriculum&#1111;'a_fall2']; ?></font></td>
            <td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $row_curriculum&#1111;'b_fall2']; ?></font></td>
            <td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $row_curriculum&#1111;'c_fall2']; ?></font></td>
            <td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $row_curriculum&#1111;'d_fall2']; ?></font></td>
            <td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $row_curriculum&#1111;'a_spring2']; ?></font></td>
            <td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $row_curriculum&#1111;'b_spring2']; ?></font></td>
            <td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $row_curriculum&#1111;'c_spring2']; ?></font></td>
            <td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $row_curriculum&#1111;'d_spring2']; ?></font></td>
            <td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $row_curriculum&#1111;'a_summer2']; ?></font></td>
            <td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $row_curriculum&#1111;'b_summer2']; ?></font></td>
            <td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $row_curriculum&#1111;'c_summer2']; ?></font></td>
            <td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $row_curriculum&#1111;'d_summer2']; ?></font></td>
            <td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $row_curriculum&#1111;'teaching_year2']; ?></font></td>
            <td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $row_curriculum&#1111;'teaching_year_semester2']; ?></font></td>
            <td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $row_curriculum&#1111;'hours_ergonomics_module']; ?></font></td>
          </tr>
          <?php &#125; while ($row_curriculum = mysql_fetch_assoc($curriculum)); ?>
it is coded exactly the same and the result is fine, prints out fine and prints out blank fields, as opposed to the above column which is only printing out one row
to view: http://www.youngdental.com/surveys/admin/all.php to see it live in action, or rather not in action, scroll all the way to the right.

Posted: Mon Jul 15, 2002 11:53 am
by PaTTeR
Insert another one field with some value.

Posted: Mon Jul 15, 2002 12:01 pm
by fariquzeli
i'm sorry i don't understand what you mean.

Posted: Mon Jul 15, 2002 1:38 pm
by fariquzeli
wait i figured out why, it wasn't outside of the <tr> <td>'s

thanks guys!