Sorry guys, but still having problem with this lovely code here:
<?
//Tour-a-Trak System
//Version 0.1 BETA
//Mark Harris (hadmharris@adelphia.net)
//New Team ROSTER creation script, writes from file to MySQL dbase
if (!$NumPlay)
{
header("Location:NewTeam.htm");
exit;
}?>
<HTML>
<HEAD>
<TITLE>Adding a New Team</Title>
</HEAD>
<BODY>
<H1> Adding a Record to <? echo "$table_name";?></H1>
<?
$dbname= "CP";
$table_name= "Players";
$connection = mysql_connect("localhost", "simconse","qria12") or
die("Couldn't Connect to Database");
$db = mysql_select_db($dbname, $connection) or
die("Couldn't select Database");
for ($x=0;$x<$NumPlay;$x++)
{
$sql = "
INSERT INTO $table_name
(FName, LName, Team, Grade, Asst, Goals, JNum)
VALUES
(\"$FName[$x]\",\"$LName[$x]\",\"$CODE\",$Grade[$x],0,0,$JNum[$x])
";
$result = mysql_query($sql,$connection);
//or die ("Couldn't Execute Query.");
echo "$sql <br>";
}
for ($x=0;$x<$NumPlay;$x++)
{
echo"<h3>
Player Addition $x <br> </h3>
Name: $FName[$x] $LName[$x] <br>
Team: $CODE<br>
Grade: $Grade[$x]<br>
Jersey Number: $JNum[$x]<br><br><br>";
}
?>
My SQL statement when dumped looks like this (when entering two players):
INSERT INTO Players (FName, LName, Team, Grade, Asst, Goals, JNum) VALUES ("Mark","Harris","MLV",12,0,0,14)
INSERT INTO Players (FName, LName, Team, Grade, Asst, Goals, JNum) VALUES ("Dave","Vatz","MLV",11,0,0,3)