php - How to end a while loop when used in a fetch assoc function

Closed. This question is off-topic. It is not currently accepting answers.Questions that are too localized (such as synt

Closed. This question is off-topic. It is not currently accepting answers.

Questions that are too localized (such as syntax errors, code with restricted access, hacked sites, hosting or support issues) are not in scope. See how do I ask a good question?

Closed 5 years ago.

Improve this question
<?php while($row = $result->fetch_assoc()); ?>
    <tr>
        <td><?php echo $row['name']; ?></td>
        <td><?php echo $row['location']; ?></td>
        <td></td>
    </tr>
<?php endwhile; ?>

syntax error, unexpected 'endwhile' (T_ENDWHILE), expecting end of file emphasized text

Closed. This question is off-topic. It is not currently accepting answers.

Questions that are too localized (such as syntax errors, code with restricted access, hacked sites, hosting or support issues) are not in scope. See how do I ask a good question?

Closed 5 years ago.

Improve this question
<?php while($row = $result->fetch_assoc()); ?>
    <tr>
        <td><?php echo $row['name']; ?></td>
        <td><?php echo $row['location']; ?></td>
        <td></td>
    </tr>
<?php endwhile; ?>

syntax error, unexpected 'endwhile' (T_ENDWHILE), expecting end of file emphasized text

Share Improve this question edited Oct 9, 2019 at 10:21 nmr 4,5672 gold badges17 silver badges25 bronze badges asked Oct 9, 2019 at 9:08 ArtisanGeeArtisanGee 1
Add a comment  | 

1 Answer 1

Reset to default 1

in while($row = $result->fetch_assoc()); semicolon occored issue. replace ; with :

<?php while($row = $result->fetch_assoc()): ?>
       <tr>
          <td><?php echo $row['name']; ?></td>
           <td><?php echo $row['location']; ?></td>
           <td></td>
        </tr>
 <?php endwhile; ?>

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745096695a4611022.html

相关推荐

  • php - How to end a while loop when used in a fetch assoc function

    Closed. This question is off-topic. It is not currently accepting answers.Questions that are too localized (such as synt

    12小时前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信