<?php require_once('db.php'); $select = "SELECT `id`, `name`, `mail`, `text` FROM `team`"; $query = mysqli_query($db, $select); $team = mysqli_fetch_all($query, MYSQLI_ASSOC); if($query) {?> <style> td { padding: 10px; background: #000; color: #fff; } form { margin-top: 10px; display: flex; flex-direction: column; } input, 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; } </style> <h2>Table Members</h2> <table> <thead> <td>ID</td> <td>NAME</td> <td>MAIL</td> <td>DESCRIPTION</td> <td>DELETE</td> <td>EDIT</td> </thead> <?php foreach($team as $member){?> <tr> <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> </tr> <?php } ?> </table> <?php if(!empty($_GET['edit_id'])){?> <form action="edit.php" method="POST"> <?php 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'] ?>"> <?php} }?> <input type="hidden" id="id" name="id" value="<?php echo $_GET['edit_id'] ?>"> <button type="submit">Submit</button> </form> <?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> </form><?php } }
Parse error: syntax error, unexpected end of file in C:\wamp64\www\php\form.php on line 83
"<?php ...;;;;;;;;;"
"?>"
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)