the way i am currently doing this is using the payment list.
the SQL
Code: Select all
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
mysql_select_db($database_hostprop, $hostprop);
$query_rs = "SELECT * FROM plus_signupComplete, host_payments2014 WHERE host_payments2014.payment_userid = plus_signupComplete.userid";
$rs = mysql_query($query_rs, $hostprop) or die(mysql_error());
$row_rs = mysql_fetch_assoc($rs);
$totalRows_rs = mysql_num_rows($rs);
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
$updateSQL = sprintf("UPDATE host_payments2014 SET id=%s WHERE payment_id=%s",
GetSQLValueString($_POST['id'], "int"),
GetSQLValueString($_POST['payment_id'], "int"));
mysql_select_db($database_hostprop, $hostprop);
$Result1 = mysql_query($updateSQL, $hostprop) or die(mysql_error());
}
Code: Select all
<table width="1000" border="1" cellspacing="0" cellpadding="5">
<tr>
<td>Student Name</td>
<td>student new id</td>
<td>id payment id</td>
<td><p>add student id to payment id</p></td>
<td>id on payment list</td>
</tr>
<?php do { ?>
<tr>
<td><?php echo $row_rs['userid']; ?></td>
<td><?php echo $row_rs['studentID']; ?></td>
<td><?php echo $row_rs['payment_userid']; ?></td>
<td><p> </p>
<form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">
<table align="center">
<tr valign="baseline">
<td nowrap="nowrap" align="right">student Id:</td>
<td><input type="text" name="id" value="<?php echo htmlentities($row_rs['id'], ENT_COMPAT, 'utf-8'); ?>" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right"> </td>
<td><input type="submit" value="Update record" /></td>
</tr>
</table>
<input type="hidden" name="MM_update" value="form1" />
<input type="hidden" name="payment_id" value="<?php echo $row_rs['payment_id']; ?>" />
</form>
<p> </p></td>
<td><?php echo $row_rs['id']; ?></td>
</tr>
<?php } while ($row_rs = mysql_fetch_assoc($rs)); ?>
</table>i want to be able to input each userID but them submit the form once rather than after each time i add a new userID
thanks