Hi!
Trying to get PHP and mysql to work on a dynamic page. I have a simple user administration system, where users can be added, deleted and removed from the database. I have a page which shows the accounts that are already made and they all have buttons to edit or remove the account. This is just a summary of the data stored in the database. Now i'm trying to get this to work:
- this is put into a table with a while ($result = mysql_query(blah)) loop
<snip>
while(blah)
<table blahblah..>
...
echo "<td align='center'>";
echo "<input type='submit' name='change$id' value='Change'></input>";
echo "</td>";
echo "<td align='center'>";
echo "<input type='submit' name='delete$id' value='Delete'></input>";
echo "</td>";
...
etc.
</snip>
The idea of the $id is that it should be possible to identify the record you are about to edit or remove. Unfortunately, i cannot pass on variables in a dynamic way like this, because i can't read them with a $_POST["delete$id"] command. That's because $id is not known. Does anyone know a good solution to this problem? Maybe i should tackle it differently? I cannot think of an easier way to solve this. I need to pass something like the unique ID of the account in the database...
Regards,
Sven M.
::edit:: - forgot to tell you that this is all put into a form, which is then passed to another PHP script. This php script takes care of the removal or editing of accounts.