editing, deleting records

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux