php - add edit button to each row in html table, to edit database -


i relatively new php, , need program doing internship... on page trying create, queried records in mysql database, , inserted them html table. trying do, add edit button in separate column of each row of table, rows can edited.. know how button there, not know how can values out of particular row, php variable can perform more queries edit, delete, etc... have been looking couple days, , looks may possible javascript, have never used javascript before, not know im looking at... appreciated

basically:

<html> <table border="1">  <th>suspended</th> <th>device name</th> <th>ip</th> <th>depend</th> <th>email</th>  <?php $sql = "select * table;"  while($row=mysql_fetch_assoc($sql)) { echo "<tr><td>".$row[0]."</td><td>".$row[1]."</td><td>".$row[2]."</td><td>".$row[3]."       </td><td>".$row[4]."</td></tr>"; } ?>  </table> </html> 

==i have not tried yet edit/delete buttons.. dont know start

for each of edit buttons create form hidden field stores uniquely identifiable id row (a primary key value).

<form action="editpage.php" method="post/get"> <input type="hidden" name="id" value="<?php echo $row_id; ?>" /> <input type="submit" value="edit"/> </form> 

then use id update fields record in database.

what $row_id? , how use $rowvalue if want insert variable or session?


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

javascript - addthis share facebook and google+ url -

ios - Show keyboard with UITextField in the input accessory view -