Search the Community
Showing results for tags 'select-box'.
-
Right now these are my tables.. i have create a page that list all the users and there is an edit button.. My question is when i click the edit button, how to view the name of the user and a select box option where the options are my course and subject that been stored? Then, when i fill the course and subject from the select box, it will stored to user_subject and user_course table.. <?php session_start(); require_once('function.php'); //Set this to what ever page you include that holds all your functions so that we can use the checkUserStatus() checkUserStatus('admin'); ?> <html> <head> <title> View Users </title> </head> <body> <h2 align='right'><a href='admin.php'>Home</a></h2> <center><h2>Users Information</h2><center> <table width='800' align='center' border='5'> <tr bgcolor='yellow'> <th>No.</th> <th>Full Name</th> <th>Matrix No.</th> <th>Username</th> <th>Password</th> <th>User Type</th> <th>Edit User</th> <th>Delete User</th> </tr> <?php mysql_connect("localhost","root",""); mysql_select_db("class_attendance"); $query = "select * from user"; $run = mysql_query($query); while ($row=mysql_fetch_array($run)){ $id = $row[0]; $full_name = $row[1]; $matrix_no = $row[2]; $username = $row[3]; $pass = $row[4]; $type = $row[5]; ?> <tr align='center'> <td><?php echo $id; ?></td> <td><?php echo $full_name; ?></td> <td><?php echo $matrix_no; ?></td> <td><?php echo $username; ?></td> <td><?php echo $pass; ?></td> <td><?php echo $type; ?></td> <td><a href='edit.php?del=<?php echo $id;?>'>Edit</a></td> <td><a href='delete.php?del=<?php echo $id;?>'>Delete</a></td> </tr> <?php } ?> </table> </body> </html>