Parse error: syntax error, Unexpected '}'

Asked

Viewed 400 times

-2

I wanted to create a dropdown, but the following error appears.

Parse error: syntax error, Unexpected '}', expecting end of file in line 96

<div class="form-group">
    <label for="user">User:</label>
    <select class="form-control" name="user" id="user">

        <option value = "0">No user</option>
        <?php>
            $q = "SELECT id FROM users ORDER BY first ASC";
            $r = mysqli_query($dbc, $q);

            while ($user_list= mysqli_fetch_assoc($r)) {
                $user_data = data_user($dbc, $user_list['id']);
                ?>
                <option value="0"><?php echo $user_data['fullname']; ?></option>

                <?php 
            } \\LINHA 96
        ?>
    </select>
</div>

1 answer

-2


When you are opening the PHP tag you put the character >, Remove it and your mistake will possibly disappear.

<?php
    $q = "SELECT id FROM users ORDER BY first ASC";
    $r = mysqli_query($dbc, $q);

    while ($user_list= mysqli_fetch_assoc($r)) {
        $user_data = data_user($dbc, $user_list['id']);
 ?>
 <option value="0"><?php echo $user_data['fullname']; ?></option>
  • 1

    I don’t understand why you’re getting negative votes when you actually helped me with the problem.

  • 2

    My friend, it’s complicated, I can’t explain the other negative vote, but I can explain my, for the same reason that the question was closed as Esse problema não pode ser reproduzido, ou é um erro de digitação., Even though I’m right, I believe that answering these kinds of questions ends up encouraging questions of the same kind.... It may have been an exaggeration on my part, but it’s my vision...

  • I also believe that your reply would be better accepted if it were only a comment, and not an answer. This is the kind of question that the biggest problem is the question itself, not the answer, but ends up going "on the tram".

Browser other questions tagged

You are not signed in. Login or sign up in order to post.