ok here is my table
CREATE TABLE member_schedule (
schedule_id int(50) unsigned NOT NULL auto_increment,
schedule_ladder varchar(255),
schedule_date varchar(255),
schedule_clan varchar(255),
schedule_ip varchar(255),
schedule_password varchar(255),
schedule_roster varchar(255),
PRIMARY KEY (schedule_id)
);
here is my php code on one page:
<tr bgcolor="<?php echo $row_colour; ?>"> <!-- Alternate Row Colours -->
<td><p><? echo $row->schedule_ladder; ?></td>
<td><p><? echo $row->schedule_date; ?></td>
<td><p><? echo $row->schedule_clan; ?></td>
<td><p><? echo $row->schedule_ip; ?></td>
<td><p><? echo $row->schedule_password; ?></td>
<td><a href="javascriptpenwindow('members_battleroster.php?id=<? echo $row->schedule_id; ?>')">View</a></td>
<td><a href="javascriptpenwindow('members_signup.php?id=<? echo $row->schedule_id; ?>')">Sign Up</a></td>
</tr>
And finally, here is my actual (not working) script:
<?
session_start();
if (session_is_registered("valid_user"))
{
?>
<html>
<head>
<basefont face="Verdana">
<LINK REL="StyleSheet" HREF="style.css" TYPE="text/css">
</head>
<body bgcolor=#202020>
<table width="100%" cellspacing="0" cellpadding="5">
<tr>
<td bgcolor=#333333><p class="head">Battle Roster:</td>
</tr>
</table>
<!-- standard page header ends -->
<?
// includes
include("config.php");
include("functions.php");
// open database connection
$connection = mysql_connect($host, $user, $pass) or die ("Unable to connect, try again later.");
// select database
mysql_select_db($db) or die ("Unable to select database, try again later.");
// generate and execute query
$query = "INSERT INTO member_schedule(schedule_roster) VALUES('$current_user')";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
$current_user = "$valid_user<br>";
// print result
echo "<p>You have been added to the roster<br><br>";
// close database connection
mysql_close($connection);
?>
</body>
</html>
<?
}
else
{
echo "<p>You are not logged in.</p>";
echo "<p>Only administrators may see this page.</p>";
}
?>
What i want to happen is:
When the user clicks on the "Sign Up" link, it brings up a popup window (i have that). IN the popup window, i want to dsplay the script member_signup.php. In member_signup.php, i want the script to insert their username to member_roster (in the table).
The problem is, i have more than one row, so i don't exactly know how to make it so that when you click on a certain sign up button, it adds your username to that particular roster... All together i'll have like 6 or 7 at a time.
I really hope this clarifies.
BTW -- Thanks for stickin with me, and i can't answer your other question.