Jump to content

N00b Parse error help


Swerve1000

Recommended Posts

Hi,

 

I'm following a tutorial and am having trouble with one line of my code:-

 

 

    <td>year_promoted</td>

    <td>promotor</td>

    <td>students</td>

  </tr>

  <?php do ( ?>    <--------------ERROR ON THIS LINE (line 42)

  <tr>

    <td><?php echo  $row['id']; ?> </td>

    <td><?php echo  $row['first_name'];  ?></td>

    <td><?php echo  $row['last_name'];  ?></td>

    <td><?php echo  $row['nickname'];  ?></td>

    <td><?php echo  $row['belt'];  ?></td>

    <td><?php echo  $row['belt_rank'];  ?></td>

    <td><?php echo  $row['country'];  ?></td>

    <td><?php echo  $row['year_promoted'];  ?></td>

    <td><?php echo  $row['promotor']; ?></td>

    <td><?php echo  $row['students']; ?></td>

  </tr>

  <?php  )while ($row = mysql_fetch_array($result)); ?>

</table>

</body>

</html>

 

---------------------------------------------------------------------------

 

The error I get is:-

 

Parse error: syntax error, unexpected ';' in C:\wamp\www\results.php on line 42

 

This is how the guy has the code in the tutorial and it works for him, but is failing to run for me.

 

It's use to to keep creating rows in a table until all results are displayed on that table.

 

I'm stuck :(

 

 

Link to comment
https://forums.phpfreaks.com/topic/50305-n00b-parse-error-help/
Share on other sites

Try changing this line:

<?php do ( ?>

 

to:

<?php do { ?>

 

I have no idea why you are using the "do" though....

 

EDIT:

Oh, and change this line:

<?php  )while ($row = mysql_fetch_array($result)); ?>

 

to

 

<?php  } while ($row = mysql_fetch_array($result)); ?>

Link to comment
https://forums.phpfreaks.com/topic/50305-n00b-parse-error-help/#findComment-246928
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.