Hey I have just made a registration system for my site and now i want to make an admin area. My registration system is made from php and mysql. I have had a go at creating a simple looking admin area but it does not work. This is the code:
Here is my problem:
It only shows the very first person in the table and their stats. I want it to show all the members going down in each row. I know that i could add on $first_name[1],$first_name[2] and so on but i dont want to have to edit my admin.php file everytime to see new members. How can this be done? thank you.
| Code: |
|
<?php include('db.php'); $sql_first_name = mysql_query("SELECT first_name FROM members"); $first_name = mysql_fetch_row($sql_first_name); $sql_last_name = mysql_query("SELECT last_name FROM members"); $last_name = mysql_fetch_row($sql_last_name); $sql_username = mysql_query("SELECT username FROM members"); $username = mysql_fetch_row($sql_username); $sql_email_address = mysql_query("SELECT email_address FROM members"); $email_address = mysql_fetch_row($sql_email_address); $sql_password = mysql_query("SELECT password FROM members"); $password = mysql_fetch_row($sql_password); $sql_activate = mysql_query("SELECT activate FROM members"); $activate = mysql_fetch_row($sql_activate); $sql_signup_date = mysql_query("SELECT signup_date FROM members"); $signup_date = mysql_fetch_row($sql_signup_date); $sql_last_login = mysql_query("SELECT last_login FROM members"); $last_login = mysql_fetch_row($sql_last_login); ?> <html> <head> <title>Table practice</title> </head> <body> <table border="1"> <tr> <th>First Name</th> <th>Last Name</th> <th>Username</th> <th>Email Address</th> <th>Password</th> <th>Activate</th> <th>Signup Date</th> <th>Last Login</th> </tr> <tr> <td><?php echo $first_name[0]?></td> <td><?php echo $last_name[0]?></td> <td><?php echo $username[0]?></td> <td><?php echo $email_address[0]?></td> <td><?php echo $password[0]?></td> <td><?php echo $activate[0]?></td> <td><?php echo $signup_date[0]?></td> <td><?php echo $last_login[0]?></td> </tr> </table> </body> </html> |
Here is my problem:
It only shows the very first person in the table and their stats. I want it to show all the members going down in each row. I know that i could add on $first_name[1],$first_name[2] and so on but i dont want to have to edit my admin.php file everytime to see new members. How can this be done? thank you.
