Swerve1000 Posted May 7, 2007 Share Posted May 7, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/50305-n00b-parse-error-help/ Share on other sites More sharing options...
pocobueno1388 Posted May 7, 2007 Share Posted May 7, 2007 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)); ?> Quote Link to comment https://forums.phpfreaks.com/topic/50305-n00b-parse-error-help/#findComment-246928 Share on other sites More sharing options...
Swerve1000 Posted May 7, 2007 Author Share Posted May 7, 2007 Thank you sir.! Fixed!! As for the 'Do', I do not know, the tutorials saying were using it to keep displaying result rows until none are left in the variable $row which contains all the data. Quote Link to comment https://forums.phpfreaks.com/topic/50305-n00b-parse-error-help/#findComment-246930 Share on other sites More sharing options...
MadTechie Posted May 7, 2007 Share Posted May 7, 2007 please click solved! Quote Link to comment https://forums.phpfreaks.com/topic/50305-n00b-parse-error-help/#findComment-246967 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.