I hope that someone can help me with a little issue. I have no idea how to solve that. For someone who works with MySQL and PHP it should be easy to explain I guess. Anyway here is what I need:
I created an admin interface with PHP. Inside the admin interface I have a table with entries from my database. So inside the table I can see the ID, username, first name, last name and so on from every single user.
Now on the right side you can see the text "Bearbeiten" which means "Edit" in English. If I click on edit I am redirected to my edit page. Problem ist, that the edit.php ist the same for every user. What I want now is, that if I click on "Bearbeiten" that I will be forwarded to the edit.php BUT that I am able to edit the specific user there.
For example if I click on "Bearbeiten" in the row where the user is with User ID 1 than I want to be redirected to edit.php?id=1 so that I am able to edit only the selected profile.
Can someone help me? What do I need to do inside my code? I would really appreciate your help!
EDIT:
Here is my table code at the user overview site:
<table class="table table-striped responsive-utilities jambo_table bulk_action"> <thead> <tr class="headings"> <th class="column-title">ID </th> <th class="column-title">Schule</th> <th class="column-title">Vorname </th> <th class="column-title">Nachname </th> <th class="column-title">Registriert am </th> <th class="column-title">Aktiv </th> <th class="column-title no-link last"><span class="nobr">Profil</span> </th> <th class="bulk-actions" colspan="7"> <a class="antoo" style="color:#fff; font-weight:500;">Mehrfachauswahl ( <span class="action-cnt"> </span> ) <i class="fa fa-chevron-down"></i></a> </th> </tr> </thead> <?php while ($row = $erg->fetch_assoc()) { ?> <tbody> <tr class="even pointer"> <td class=" "><?php echo $row['id']; ?></td> <td class=" "><?php echo $row['schule']; ?></td> <td class=" "><?php echo $row['firstname'];?></td> <td class=" "><?php echo $row['lastname']; ?></td> <td class=" "><?php echo $row['registration']; ?></td> <td class="a-right a-right "><?php echo $row['active']; ?></td> <td class=" last"><a href="edit_profil_teacher.php?id=<?php echo $id; ?>">Bearbeiten</a> </td> </tr> <?php } ?> </tbody> <?php $erg->close(); ?> </table> Here is what I entered at the top of my edit page:
<?php $user_id = (int)$_GET['id']; ?> Problem right now is that URL at user overview page changed to edit.php?id= but that´s it. It does not select the correct ID. What am I missing?
Thanks, Chris

mysqliorpdoand you should be able to figure it out from there. To answer you other question, yes you can pass in theIDof the item you are trying to edit with a GET parameter. A word of caution though, it'd be very easy to simply change whichIDyou are editing by changing the URL, so be sure to implement proper security.Whatdo I need to do inside mycode?" - Two operative words here being the first and the last in that sentence..., including the question mark - That's just it... "What code"?