Click here to Skip to main content
15,566,520 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
    $select = "SELECT `id`, `name`, `mail`, `text` FROM `team`";
    $query = mysqli_query($db, $select);
    $team = mysqli_fetch_all($query, MYSQLI_ASSOC);

    if($query) {?>
            td {
                padding: 10px;
                background: #000;
                color: #fff;
            form {
                margin-top: 10px;
                display: flex;
                flex-direction: column;
            button {
                margin-top: 5px;
                width: 300px;
                border-radius: 5px;
            a {
                text-decoration: none;
                color: inherit;
                transition: all 0.6s ease 0s;
            a:hover {
                transition: all 0.6s ease 0s;
                text-decoration: underline;
        <h2>Table Members</h2>
        <?php foreach($team as $member){?>
                <td><?php echo $member[id] ?></td>
                <td><?php echo $member[name] ?></td>
                <td><?php echo $member[mail] ?></td>
                <td><?php echo $member[text] ?></td>
                <td><a href="delete.php?member_id=<?php echo $member[id]?>">Delete</a></td>
                <td><a href="index.php?edit_id=<?php echo $member[id]?>">Edit</a></td>
        <?php } ?>
        <?php if(!empty($_GET['edit_id'])){?>
            <form action="edit.php" method="POST">
                    foreach($team as $member) {
                        if($member['id'] == $_GET['edit_id']) {?>
                            <label for="name">Edit name of member</label>
                            <input type="text" id="name" name="name" value="<?php echo $member['name'] ?>">
                            <label for="mail">Edit mail of member</label>
                            <input type="text" id="mail" name="mail" value="<?php echo $member['mail'] ?>">
                            <label for="text">Edit description</label>
                            <input type="text" id="text" name="text" value="<?php echo $member['text'] ?>">
                <input type="hidden" id="id" name="id" value="<?php echo $_GET['edit_id'] ?>">
                <button type="submit">Submit</button>
        <?php } else {?>
            <form action="add.php" method="POST">
                <label for="name">Write name of member</label>
                <input type="text" id="name" name="name">
                <label for="mail">Write mail of member</label>
                <input type="text" id="mail" name="mail">
                <label for="text">Write description</label>
                <input type="text" id="text" name="text">
                <button type="submit">Add</button>

What I have tried:

Parse error: syntax error, unexpected end of file in C:\wamp64\www\php\form.php on line 83
Afzaal Ahmad Zeeshan 29-Nov-22 17:43pm    
You have an open PHP tag in the file that causes the compiler to assume more code is incoming. You should use a PHP linter.
Member 15627495 30-Nov-22 1:07am    
don't forget to close all instructions lines php with ";"
a php scope start by
"<?php ...;;;;;;;;;"
and ends by
Sandeep Mewara 2-Dec-22 11:50am    
You shouldn't put brackets directly close to the open/close php tag, but separate it with a space:

{ ?>
<?php {

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900