editing, deleting records

From: Date: Thu, 22 Jan 2004 17:54:54 +0000
Subject: editing, deleting records
Groups: php.db 
Request: Send a blank email to php-db+get-32588@lists.php.net to get a copy of this message
Here's a part of my code, which is retrieving player records from mysql and displaying them in a table: ----------------------------------------- if($queryChk3 !== 0){ print("<form action='$_SERVER['PHP_SELF']' method='POST'> <input type='hidden' name='teamID' value='$teamID'> <input type='hidden' name='pwd' value='$pwd'> <table border='1'><tr> <td colspan='7'><b>Player Roster for $teamName</b></td></tr> <tr><td><b>Last Name</b></td><td><b>First Name</b></td> <td><b>DOB</b></td><td><b>Telephone</b></td> <td><b>Address</b></td><td><b>Email</b></td> <td><b>Sex</b></td></tr>"); while($row = mysql_fetch_array($query3)) { print("<tr>"); $lname = $row['lname']; $fname = $row['fname']; $dob = $row['dob']; $phone = $row['phone']; $address = $row['address']; $email = $row['email']; $sex = $row['sex']; print("<td>" . $lname . "</td><td>" . $fname . "</td><td>" . $dob . "</td><td>" . $phone . "</td><td>" . $address . "</td><td>" . $email . "</td><td>" . $sex . "</td>"); print("</tr>"); } print("</table><input type='submit' name='Submit'></form>"); } ------------------------------------------ I'd like to add buttons to "edit this record" and "delete this record" to each row but I'm not sure how to get it done. It seems like I'd have to add a hidden variable (playerID, which is my primary key for the table "players") to each row printed but how do I manage unique "submits" since I'm already inside a form? I must be missing something obvious - please help! Thanks, Kirk

« previous php.db (#32588) next »