This is my first post in a forum, so I apologize if I have made some grave error. I am relatively new to php and know very little about javascript, so I have hit a roadblock in my endeavor. I have read a bunch of data from a mysql database, and I display it on the screen. Then I want to be able to change fields within the database based on what checkboxes are ticked and text is added. That may sound confusing, so I have included my code on the bottom of this post. I do understand enough about php to know that it is running server side, and that all my php requests are done pre-user interaction. That is why I have been unable to come up with a solution to my problem.
If anyone could give me insight onto a better method of achieving my goal, I would greatly appreciate the help.
Thank you for taking the time to read my post, and I hope to hear from some of the intelligent minds out there.
SirBee
<?php
include 'connect.PHP';
$registrationQuery=mysql_query("SELECT
`registration`.`registrationID` AS `registrationID`,
`registration`.`semi_identifier` AS `semi_identifier`,
`registration`.`teamName` AS `teamName`,
`registration`.`userName` AS `userName`,
`registration`.`cFirst` AS `cFirst`,
`registration`.`cLast` AS `cLast`,
`registration`.`comments` AS `comments`,
`registration`.`registered` AS `registered`,
`registration`.`paid` AS `paid`,
`registration`.`notes` AS `notes`
FROM
`regcategory`
Inner Join `registration` ON `regcategory`.`semi_identifier` = `registration`.`semi_identifier`
WHERE
`regcategory`.`season` = 'summer' ORDER BY `regcategory`.`semi_identifier`, `registration`.`registrationID`");
?>
<TABLE ALIGN=CENTER cellspacing='2' CELLPADDING='2'>
<TR><TD ALIGN=CENTER colspan=6><font size=4 face=arial><BR><b>Registrations - Sorted by league</b><BR><BR></font></TD></TR>
<?php
$teamTemp="";
while($registration_array=mysql_fetch_array($registrationQuery)){
$team=$registration_array['semi_identifier'];
if($team!=$teamTemp){
$teamNum=0;
$teamTemp=$team;
$q=mysql_query("SELECT * FROM regcategory WHERE semi_identifier='$team'");
$a=mysql_fetch_array($q);
?>
<TR><TD align=center colspan=7 bgcolor="#33CCFF"><font size=2><b><?php print $a['category']?></b></font></TD>
<TD align="center"><input type="submit" value="Save Changes"></TD></TR>
<TR><TD align=center><font size=2><b><u>Team Number</TD><TD align=center><font size=2><b><u>Team Name</TD>
<TD align=center><font size=2><b><u>Captain</TD><TD align=center><font size=2><b><u>Username</TD><TD align=center><font size=2><b><u>Con (Y/N)</TD>
<TD align=center><font size=2><b><u>Paid</TD><TD align=center><font size=2><b><u>Delete</TD><TD align=center><font size=2><b><u>Notes</TD></TR>
<?php
}
$teamNum+=1;
?>
<TR><TD align=center><font size=2><?php print $teamNum;?></td><TD align=center><font size=2><?php print $registration_array['teamName'];?></td>
<TD align=center><font size=2><?php print $registration_array['cFirst']." ".$registration_array['cLast'];?></td>
<TD align=center><font size=2><?php print $registration_array['userName']?></td>
<TD align=center><font size=2><?php if($registration_array['registered']=='1'){print "<B>Y</B>";}else{print "N";}?></td>
<TD align=center>
<?php if($registration_array['paid']=='1'){?><input type="checkbox" checked name="paid" value="1"></TD><?php }else{?><input type="checkbox" name="paid" value="1"></TD>
<?php }?> <TD align=center><input type="checkbox" name="delete" value="1"></TD><TD><input type="text" name="notes"></TD>
<?php if($registration_array['comments']!=""){?><TR><TD></TD><TD COLSPAN=6 align=LEFT width=500><FONT SIZE=2 color='blue'><i>
<?php print 'Comment: "'.nl2br($registration_array['comments']).'"';?></TD></TR<?php }?>
<?php if($registration_array['notes']!=""){?><TR><TD></TD><TD COLSPAN=6 align=LEFT width=500><FONT SIZE=2 color='red'><i>
<?php print 'Notes: "'.nl2br($registration_array['notes']).'"';?></TD></TR<?php }
}?>
</TABLE>


Sign In
Create Account


Back to top










