Jump to content

Recommended Posts

<?php

$db_name="***";
$connection=mysql_connect("localhost","***","****") or die("I Couldn't connect");
$db=mysql_select_db($db_name,$connection) or die("I Couldn't select your database");
$table="player"; // Table name
$sql="select user, first, last, birth, address, city, state, zip, email, grade, team, coach, height, weight, gpa, sat, phone, other from $table WHERE user='$user'";
$result=mysql_query($sql,$connection) or die(mysql_error());
$num = mysql_numrows($result,$connection);

if($num != 0){
while($row=mysql_fetch_array($result)) {

?> 
<form method="post" action="../player/insertupdate.php"> 
<input type="hidden" name="user" value="<?php echo $user; ?>">
  <p>First Name
    <input type="text" name="first" maxlength="20" value="<?php echo $row['first']; ?>">
 Last Name
    <input type="text" name="last" maxlength="20" value="<?php echo $row['last']; ?>">
  </p>
  <p>Birth Date
    <input type="text" name="birth" maxlength="20" value="<?php echo $row['birth']; ?>">
  
  Address 
    <input type="text" name="address" maxlength="50" value="<?php echo $row['address']; ?>">
  </p>
  <p>
    City
    <input type="text" name="city" maxlength="20" value="<?php echo $row['city']; ?>">
    State 
    <select name="state" value="<?php echo $row['state']; ?>">
      #
<option value="">None</option>
#
<option value="AL">Alabama</option>
#
<option value="AK">Alaska</option>
#
<option value="AZ">Arizona</option>
#
<option value="AR">Arkansas</option>
#
<option value="CA">California</option>
#
<option value="CO">Colorado</option>
#
<option value="CT">Connecticut</option>
#
<option value="DC">District of Columbia</option>
#
<option value="DE">Delaware</option>
#
<option value="FL">Florida</option>
#
<option value="GA">Georgia</option>
#
<option value="HI">Hawaii</option>
#
<option value="ID">Idaho</option>
#
<option value="IL">Illinois</option>
#
<option value="IN">Indiana</option>
#
<option value="IA">Iowa</option>
#
<option value="KS">Kansas</option>
#
<option value="KY">Kentucky</option>
#
<option value="LA">Louisiana</option>
#
<option value="ME">Maine</option>
#
<option value="MD">Maryland</option>
#
<option value="MA">Massachusetts</option>
#
<option value="MI">Michigan</option>
#
<option value="MN">Minnesota</option>
#
<option value="MS">Mississippi</option>
#
<option value="MO">Missouri</option>
#
<option value="MT">Montana</option>
#
<option value="NE">Nebraska</option>
#
<option value="NV">Nevada</option>
#
<option value="NH">New Hampshire</option>
#
<option value="NJ">New Jersey</option>
#
<option value="NM">New Mexico</option>
#
<option value="NY">New York</option>
#
<option value="NC">North Carolina</option>
#
<option value="ND">North Dakota</option>
#
<option value="OH">Ohio</option>
#
<option value="OK">Oklahoma</option>
#
<option value="OR">Oregon</option>
#
<option value="PA">Pennsylvania</option>
#
<option value="PR">Puerto Rico</option>
#
<option value="RI">Rhode Island</option>
#
<option value="SC">South Carolina</option>
#
<option value="SD">South Dakota</option>
#
<option value="TN">Tennessee</option>
#
<option value="TX">Texas</option>
#
<option value="UT">Utah</option>
#
<option value="VT">Vermont</option>
#
<option value="VA">Virginia</option>
#
<option value="WA">Washington</option>
#
<option value="WV">West Virginia</option>
#
<option value="WI">Wisconsin</option>
#
<option value="WY">Wyoming</option>
#

    </select> 
    Zipcode 
    <input type="text" name="zip" maxlength="5" value="<?php echo $row['zip']; ?>">
  </p>
  <p>Phone ex.(555) 555-5555 <input type="text" name="phone" maxlength="20" value="<?php echo $row['phone']; ?>">
 Email <input type="text" name="email" maxlength="50" value="<?php echo $row['email']; ?>"> </p>
  
  <p>Grade <input type="text" name="grade" maxlength="10" value="<?php echo $row['grade']; ?>">
  School <input type="text" name="team" maxlength="20" value="<?php echo $row['team']; ?>">
  </p>
  <p>Coach <input type="text" name="coach" maxlength="20" value="<?php echo $row['coach']; ?>">
  Height <input type="text" name="height" maxlength="10" value="<?php echo $row['height']; ?>">
  Weight <input type="text" name="weight" maxlength="10" value="<?php echo $row['weight']; ?>">
  </p>
   <p>Grade Point Average (GPA) <input type="text" name="gpa" maxlength="10" value="<?php echo $row['gpa']; ?>">
  SAT Score <input type="text" name="sat" maxlength="5" value="<?php echo $row['sat']; ?>">
  </p>
  <p>
  Notable Academic and Athletic Achievments: (2500 Character Maximum) </p>
  
  
  <textarea name="other" rows="10" cols="50"><?php echo $row['other']; ?> </textarea>
  <p><input type="submit" value="Submit"></p> 
</form>
<?php
}
}else{

?>
<form method="post" action="../player/insertplayer.php"> 
  <p>First Name
    <input type="text" name="first" maxlength="20">
 Last Name
    <input type="text" name="last" maxlength="20">
  </p>
  <p>Birth Date
    <input type="text" name="birth" maxlength="20">
  
  Address 
    <input type="text" name="address" maxlength="50">
  </p>
  <p>
    City
    <input type="text" name="city" maxlength="20">
    State 
    <select name="state">
      #
<option value="">None</option>
#
<option value="AL">Alabama</option>
#
<option value="AK">Alaska</option>
#
<option value="AZ">Arizona</option>
#
<option value="AR">Arkansas</option>
#
<option value="CA">California</option>
#
<option value="CO">Colorado</option>
#
<option value="CT">Connecticut</option>
#
<option value="DC">District of Columbia</option>
#
<option value="DE">Delaware</option>
#
<option value="FL">Florida</option>
#
<option value="GA">Georgia</option>
#
<option value="HI">Hawaii</option>
#
<option value="ID">Idaho</option>
#
<option value="IL">Illinois</option>
#
<option value="IN">Indiana</option>
#
<option value="IA">Iowa</option>
#
<option value="KS">Kansas</option>
#
<option value="KY">Kentucky</option>
#
<option value="LA">Louisiana</option>
#
<option value="ME">Maine</option>
#
<option value="MD">Maryland</option>
#
<option value="MA">Massachusetts</option>
#
<option value="MI">Michigan</option>
#
<option value="MN">Minnesota</option>
#
<option value="MS">Mississippi</option>
#
<option value="MO">Missouri</option>
#
<option value="MT">Montana</option>
#
<option value="NE">Nebraska</option>
#
<option value="NV">Nevada</option>
#
<option value="NH">New Hampshire</option>
#
<option value="NJ">New Jersey</option>
#
<option value="NM">New Mexico</option>
#
<option value="NY">New York</option>
#
<option value="NC">North Carolina</option>
#
<option value="ND">North Dakota</option>
#
<option value="OH">Ohio</option>
#
<option value="OK">Oklahoma</option>
#
<option value="OR">Oregon</option>
#
<option value="PA">Pennsylvania</option>
#
<option value="PR">Puerto Rico</option>
#
<option value="RI">Rhode Island</option>
#
<option value="SC">South Carolina</option>
#
<option value="SD">South Dakota</option>
#
<option value="TN">Tennessee</option>
#
<option value="TX">Texas</option>
#
<option value="UT">Utah</option>
#
<option value="VT">Vermont</option>
#
<option value="VA">Virginia</option>
#
<option value="WA">Washington</option>
#
<option value="WV">West Virginia</option>
#
<option value="WI">Wisconsin</option>
#
<option value="WY">Wyoming</option>
#

    </select> 
    Zipcode 
    <input type="text" name="zip" maxlength="5" >
  </p>
  <p>Phone ex.(555) 555-5555 <input type="text" name="phone" maxlength="20">
 Email <input type="text" name="email" maxlength="50"> </p>
  
  <p>Grade <input type="text" name="grade" maxlength="10">
  
   <?php

$host="localhost"; // Host name 
$username="****"; // Mysql username 
$password="***"; // Mysql password 
$db_name="****"; // Database name 
$tbl_name="teams"; // Table name 

// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or die("cannot connect"); 
mysql_select_db("$db_name")or die("cannot select DB");

// Retrieve data from database 
$sql="SELECT team FROM $tbl_name ORDER BY team";
$result=mysql_query($sql);
?>

  School <select name = "team">
<?php
// Start looping rows in mysql database.
while($rows=mysql_fetch_array($result)){
?>
  <option value = <?php echo $rows['team']; ?>><?php echo $rows['team']; ?></option> <?php
// close while loop 
}

// close connection 
mysql_close();
?>         
                             </select>
  </p>
  <p>Coach <input type="text" name="coach" maxlength="20">
  Height <input type="text" name="height" maxlength="10">
  Weight <input type="text" name="weight" maxlength="10">
  </p>
   <p>Grade Point Average (GPA) <input type="text" name="gpa" maxlength="10">
  SAT Score <input type="text" name="sat" maxlength="5">
  </p>
  <p>
  Notable Academic and Athletic Achievments: (2500 Character Maximum) </p>
  
  
  <textarea name="other" rows="10" cols="50"> </textarea>
  <p><input type="submit" value="Submit"></p>
</form>
<?php
}
?>

Gives me this error with or without an entry in the DB.

Warning: Wrong parameter count for mysql_numrows()[/qoute]

 

Also it tries to display the "else" statement with or without the entry in the DB.

 

<?php

$db_name="***";
$connection=mysql_connect("localhost","***","****") or die("I Couldn't connect");
$db=mysql_select_db($db_name,$connection) or die("I Couldn't select your database");
$table="player"; // Table name
$sql="select user, first, last, birth, address, city, state, zip, email, grade, team, coach, height, weight, gpa, sat, phone, other from $table WHERE user='$user'";
$result=mysql_query($sql,$connection) or die(mysql_error());
$num = mysql_numrows($result,$connection);

if($num != 0){
while($row=mysql_fetch_array($result)) {

?> 
<form method="post" action="../player/insertupdate.php"> 
<input type="hidden" name="user" value="<?php echo $user; ?>">
  <p>First Name
    <input type="text" name="first" maxlength="20" value="<?php echo $row['first']; ?>">
 Last Name
    <input type="text" name="last" maxlength="20" value="<?php echo $row['last']; ?>">
  </p>
  <p>Birth Date
    <input type="text" name="birth" maxlength="20" value="<?php echo $row['birth']; ?>">
  
  Address 
    <input type="text" name="address" maxlength="50" value="<?php echo $row['address']; ?>">
  </p>
  <p>
    City
    <input type="text" name="city" maxlength="20" value="<?php echo $row['city']; ?>">
    State 
    <select name="state" value="<?php echo $row['state']; ?>">
      #
<option value="">None</option>
#
<option value="AL">Alabama</option>
#
<option value="AK">Alaska</option>
#
<option value="AZ">Arizona</option>
#
<option value="AR">Arkansas</option>
#
<option value="CA">California</option>
#
<option value="CO">Colorado</option>
#
<option value="CT">Connecticut</option>
#
<option value="DC">District of Columbia</option>
#
<option value="DE">Delaware</option>
#
<option value="FL">Florida</option>
#
<option value="GA">Georgia</option>
#
<option value="HI">Hawaii</option>
#
<option value="ID">Idaho</option>
#
<option value="IL">Illinois</option>
#
<option value="IN">Indiana</option>
#
<option value="IA">Iowa</option>
#
<option value="KS">Kansas</option>
#
<option value="KY">Kentucky</option>
#
<option value="LA">Louisiana</option>
#
<option value="ME">Maine</option>
#
<option value="MD">Maryland</option>
#
<option value="MA">Massachusetts</option>
#
<option value="MI">Michigan</option>
#
<option value="MN">Minnesota</option>
#
<option value="MS">Mississippi</option>
#
<option value="MO">Missouri</option>
#
<option value="MT">Montana</option>
#
<option value="NE">Nebraska</option>
#
<option value="NV">Nevada</option>
#
<option value="NH">New Hampshire</option>
#
<option value="NJ">New Jersey</option>
#
<option value="NM">New Mexico</option>
#
<option value="NY">New York</option>
#
<option value="NC">North Carolina</option>
#
<option value="ND">North Dakota</option>
#
<option value="OH">Ohio</option>
#
<option value="OK">Oklahoma</option>
#
<option value="OR">Oregon</option>
#
<option value="PA">Pennsylvania</option>
#
<option value="PR">Puerto Rico</option>
#
<option value="RI">Rhode Island</option>
#
<option value="SC">South Carolina</option>
#
<option value="SD">South Dakota</option>
#
<option value="TN">Tennessee</option>
#
<option value="TX">Texas</option>
#
<option value="UT">Utah</option>
#
<option value="VT">Vermont</option>
#
<option value="VA">Virginia</option>
#
<option value="WA">Washington</option>
#
<option value="WV">West Virginia</option>
#
<option value="WI">Wisconsin</option>
#
<option value="WY">Wyoming</option>
#

    </select> 
    Zipcode 
    <input type="text" name="zip" maxlength="5" value="<?php echo $row['zip']; ?>">
  </p>
  <p>Phone ex.(555) 555-5555 <input type="text" name="phone" maxlength="20" value="<?php echo $row['phone']; ?>">
 Email <input type="text" name="email" maxlength="50" value="<?php echo $row['email']; ?>"> </p>
  
  <p>Grade <input type="text" name="grade" maxlength="10" value="<?php echo $row['grade']; ?>">
  School <input type="text" name="team" maxlength="20" value="<?php echo $row['team']; ?>">
  </p>
  <p>Coach <input type="text" name="coach" maxlength="20" value="<?php echo $row['coach']; ?>">
  Height <input type="text" name="height" maxlength="10" value="<?php echo $row['height']; ?>">
  Weight <input type="text" name="weight" maxlength="10" value="<?php echo $row['weight']; ?>">
  </p>
   <p>Grade Point Average (GPA) <input type="text" name="gpa" maxlength="10" value="<?php echo $row['gpa']; ?>">
  SAT Score <input type="text" name="sat" maxlength="5" value="<?php echo $row['sat']; ?>">
  </p>
  <p>
  Notable Academic and Athletic Achievments: (2500 Character Maximum) </p>
  
  
  <textarea name="other" rows="10" cols="50"><?php echo $row['other']; ?> </textarea>
  <p><input type="submit" value="Submit"></p> 
</form>
<?php
}
}else{

?>
<form method="post" action="../player/insertplayer.php"> 
  <p>First Name
    <input type="text" name="first" maxlength="20">
 Last Name
    <input type="text" name="last" maxlength="20">
  </p>
  <p>Birth Date
    <input type="text" name="birth" maxlength="20">
  
  Address 
    <input type="text" name="address" maxlength="50">
  </p>
  <p>
    City
    <input type="text" name="city" maxlength="20">
    State 
    <select name="state">
      #
<option value="">None</option>
#
<option value="AL">Alabama</option>
#
<option value="AK">Alaska</option>
#
<option value="AZ">Arizona</option>
#
<option value="AR">Arkansas</option>
#
<option value="CA">California</option>
#
<option value="CO">Colorado</option>
#
<option value="CT">Connecticut</option>
#
<option value="DC">District of Columbia</option>
#
<option value="DE">Delaware</option>
#
<option value="FL">Florida</option>
#
<option value="GA">Georgia</option>
#
<option value="HI">Hawaii</option>
#
<option value="ID">Idaho</option>
#
<option value="IL">Illinois</option>
#
<option value="IN">Indiana</option>
#
<option value="IA">Iowa</option>
#
<option value="KS">Kansas</option>
#
<option value="KY">Kentucky</option>
#
<option value="LA">Louisiana</option>
#
<option value="ME">Maine</option>
#
<option value="MD">Maryland</option>
#
<option value="MA">Massachusetts</option>
#
<option value="MI">Michigan</option>
#
<option value="MN">Minnesota</option>
#
<option value="MS">Mississippi</option>
#
<option value="MO">Missouri</option>
#
<option value="MT">Montana</option>
#
<option value="NE">Nebraska</option>
#
<option value="NV">Nevada</option>
#
<option value="NH">New Hampshire</option>
#
<option value="NJ">New Jersey</option>
#
<option value="NM">New Mexico</option>
#
<option value="NY">New York</option>
#
<option value="NC">North Carolina</option>
#
<option value="ND">North Dakota</option>
#
<option value="OH">Ohio</option>
#
<option value="OK">Oklahoma</option>
#
<option value="OR">Oregon</option>
#
<option value="PA">Pennsylvania</option>
#
<option value="PR">Puerto Rico</option>
#
<option value="RI">Rhode Island</option>
#
<option value="SC">South Carolina</option>
#
<option value="SD">South Dakota</option>
#
<option value="TN">Tennessee</option>
#
<option value="TX">Texas</option>
#
<option value="UT">Utah</option>
#
<option value="VT">Vermont</option>
#
<option value="VA">Virginia</option>
#
<option value="WA">Washington</option>
#
<option value="WV">West Virginia</option>
#
<option value="WI">Wisconsin</option>
#
<option value="WY">Wyoming</option>
#

    </select> 
    Zipcode 
    <input type="text" name="zip" maxlength="5" >
  </p>
  <p>Phone ex.(555) 555-5555 <input type="text" name="phone" maxlength="20">
 Email <input type="text" name="email" maxlength="50"> </p>
  
  <p>Grade <input type="text" name="grade" maxlength="10">
  
   <?php

$host="localhost"; // Host name 
$username="****"; // Mysql username 
$password="***"; // Mysql password 
$db_name="****"; // Database name 
$tbl_name="teams"; // Table name 

// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or die("cannot connect"); 
mysql_select_db("$db_name")or die("cannot select DB");

// Retrieve data from database 
$sql="SELECT team FROM $tbl_name ORDER BY team";
$result=mysql_query($sql);
?>

  School <select name = "team">
<?php
// Start looping rows in mysql database.
while($rows=mysql_fetch_array($result)){
?>
  <option value = <?php echo $rows['team']; ?>><?php echo $rows['team']; ?></option> <?php
// close while loop 
}

// close connection 
mysql_close();
?>         
                             </select>
  </p>
  <p>Coach <input type="text" name="coach" maxlength="20">
  Height <input type="text" name="height" maxlength="10">
  Weight <input type="text" name="weight" maxlength="10">
  </p>
   <p>Grade Point Average (GPA) <input type="text" name="gpa" maxlength="10">
  SAT Score <input type="text" name="sat" maxlength="5">
  </p>
  <p>
  Notable Academic and Athletic Achievments: (2500 Character Maximum) </p>
  
  
  <textarea name="other" rows="10" cols="50"> </textarea>
  <p><input type="submit" value="Submit"></p>
</form>
<?php
}
?>

<?php

$db_name="***";
$connection=mysql_connect("localhost","***","****") or die("I Couldn't connect");
$db=mysql_select_db($db_name,$connection) or die("I Couldn't select your database");
$table="player"; // Table name
$sql="select user, first, last, birth, address, city, state, zip, email, grade, team, coach, height, weight, gpa, sat, phone, other from $table WHERE user='$user'";
$result=mysql_query($sql,$connection) or die(mysql_error());
$num = mysql_numrows($result);

if($num != 0){
while($row=mysql_fetch_array($result)) {

?> 
<form method="post" action="../player/insertupdate.php"> 
<input type="hidden" name="user" value="<?php echo $user; ?>">
  <p>First Name
    <input type="text" name="first" maxlength="20" value="<?php echo $row['first']; ?>">
 Last Name
    <input type="text" name="last" maxlength="20" value="<?php echo $row['last']; ?>">
  </p>
  <p>Birth Date
    <input type="text" name="birth" maxlength="20" value="<?php echo $row['birth']; ?>">
  
  Address 
    <input type="text" name="address" maxlength="50" value="<?php echo $row['address']; ?>">
  </p>
  <p>
    City
    <input type="text" name="city" maxlength="20" value="<?php echo $row['city']; ?>">
    State 
    <select name="state" value="<?php echo $row['state']; ?>">
      #
<option value="">None</option>
#
<option value="AL">Alabama</option>
#
<option value="AK">Alaska</option>
#
<option value="AZ">Arizona</option>
#
<option value="AR">Arkansas</option>
#
<option value="CA">California</option>
#
<option value="CO">Colorado</option>
#
<option value="CT">Connecticut</option>
#
<option value="DC">District of Columbia</option>
#
<option value="DE">Delaware</option>
#
<option value="FL">Florida</option>
#
<option value="GA">Georgia</option>
#
<option value="HI">Hawaii</option>
#
<option value="ID">Idaho</option>
#
<option value="IL">Illinois</option>
#
<option value="IN">Indiana</option>
#
<option value="IA">Iowa</option>
#
<option value="KS">Kansas</option>
#
<option value="KY">Kentucky</option>
#
<option value="LA">Louisiana</option>
#
<option value="ME">Maine</option>
#
<option value="MD">Maryland</option>
#
<option value="MA">Massachusetts</option>
#
<option value="MI">Michigan</option>
#
<option value="MN">Minnesota</option>
#
<option value="MS">Mississippi</option>
#
<option value="MO">Missouri</option>
#
<option value="MT">Montana</option>
#
<option value="NE">Nebraska</option>
#
<option value="NV">Nevada</option>
#
<option value="NH">New Hampshire</option>
#
<option value="NJ">New Jersey</option>
#
<option value="NM">New Mexico</option>
#
<option value="NY">New York</option>
#
<option value="NC">North Carolina</option>
#
<option value="ND">North Dakota</option>
#
<option value="OH">Ohio</option>
#
<option value="OK">Oklahoma</option>
#
<option value="OR">Oregon</option>
#
<option value="PA">Pennsylvania</option>
#
<option value="PR">Puerto Rico</option>
#
<option value="RI">Rhode Island</option>
#
<option value="SC">South Carolina</option>
#
<option value="SD">South Dakota</option>
#
<option value="TN">Tennessee</option>
#
<option value="TX">Texas</option>
#
<option value="UT">Utah</option>
#
<option value="VT">Vermont</option>
#
<option value="VA">Virginia</option>
#
<option value="WA">Washington</option>
#
<option value="WV">West Virginia</option>
#
<option value="WI">Wisconsin</option>
#
<option value="WY">Wyoming</option>
#

    </select> 
    Zipcode 
    <input type="text" name="zip" maxlength="5" value="<?php echo $row['zip']; ?>">
  </p>
  <p>Phone ex.(555) 555-5555 <input type="text" name="phone" maxlength="20" value="<?php echo $row['phone']; ?>">
 Email <input type="text" name="email" maxlength="50" value="<?php echo $row['email']; ?>"> </p>
  
  <p>Grade <input type="text" name="grade" maxlength="10" value="<?php echo $row['grade']; ?>">
  School <input type="text" name="team" maxlength="20" value="<?php echo $row['team']; ?>">
  </p>
  <p>Coach <input type="text" name="coach" maxlength="20" value="<?php echo $row['coach']; ?>">
  Height <input type="text" name="height" maxlength="10" value="<?php echo $row['height']; ?>">
  Weight <input type="text" name="weight" maxlength="10" value="<?php echo $row['weight']; ?>">
  </p>
   <p>Grade Point Average (GPA) <input type="text" name="gpa" maxlength="10" value="<?php echo $row['gpa']; ?>">
  SAT Score <input type="text" name="sat" maxlength="5" value="<?php echo $row['sat']; ?>">
  </p>
  <p>
  Notable Academic and Athletic Achievments: (2500 Character Maximum) </p>
  
  
  <textarea name="other" rows="10" cols="50"><?php echo $row['other']; ?> </textarea>
  <p><input type="submit" value="Submit"></p> 
</form>
<?php
}
}else{

?>
<form method="post" action="../player/insertplayer.php"> 
  <p>First Name
    <input type="text" name="first" maxlength="20">
 Last Name
    <input type="text" name="last" maxlength="20">
  </p>
  <p>Birth Date
    <input type="text" name="birth" maxlength="20">
  
  Address 
    <input type="text" name="address" maxlength="50">
  </p>
  <p>
    City
    <input type="text" name="city" maxlength="20">
    State 
    <select name="state">
      #
<option value="">None</option>
#
<option value="AL">Alabama</option>
#
<option value="AK">Alaska</option>
#
<option value="AZ">Arizona</option>
#
<option value="AR">Arkansas</option>
#
<option value="CA">California</option>
#
<option value="CO">Colorado</option>
#
<option value="CT">Connecticut</option>
#
<option value="DC">District of Columbia</option>
#
<option value="DE">Delaware</option>
#
<option value="FL">Florida</option>
#
<option value="GA">Georgia</option>
#
<option value="HI">Hawaii</option>
#
<option value="ID">Idaho</option>
#
<option value="IL">Illinois</option>
#
<option value="IN">Indiana</option>
#
<option value="IA">Iowa</option>
#
<option value="KS">Kansas</option>
#
<option value="KY">Kentucky</option>
#
<option value="LA">Louisiana</option>
#
<option value="ME">Maine</option>
#
<option value="MD">Maryland</option>
#
<option value="MA">Massachusetts</option>
#
<option value="MI">Michigan</option>
#
<option value="MN">Minnesota</option>
#
<option value="MS">Mississippi</option>
#
<option value="MO">Missouri</option>
#
<option value="MT">Montana</option>
#
<option value="NE">Nebraska</option>
#
<option value="NV">Nevada</option>
#
<option value="NH">New Hampshire</option>
#
<option value="NJ">New Jersey</option>
#
<option value="NM">New Mexico</option>
#
<option value="NY">New York</option>
#
<option value="NC">North Carolina</option>
#
<option value="ND">North Dakota</option>
#
<option value="OH">Ohio</option>
#
<option value="OK">Oklahoma</option>
#
<option value="OR">Oregon</option>
#
<option value="PA">Pennsylvania</option>
#
<option value="PR">Puerto Rico</option>
#
<option value="RI">Rhode Island</option>
#
<option value="SC">South Carolina</option>
#
<option value="SD">South Dakota</option>
#
<option value="TN">Tennessee</option>
#
<option value="TX">Texas</option>
#
<option value="UT">Utah</option>
#
<option value="VT">Vermont</option>
#
<option value="VA">Virginia</option>
#
<option value="WA">Washington</option>
#
<option value="WV">West Virginia</option>
#
<option value="WI">Wisconsin</option>
#
<option value="WY">Wyoming</option>
#

    </select> 
    Zipcode 
    <input type="text" name="zip" maxlength="5" >
  </p>
  <p>Phone ex.(555) 555-5555 <input type="text" name="phone" maxlength="20">
 Email <input type="text" name="email" maxlength="50"> </p>
  
  <p>Grade <input type="text" name="grade" maxlength="10">
  
   <?php

$host="localhost"; // Host name 
$username="****"; // Mysql username 
$password="***"; // Mysql password 
$db_name="****"; // Database name 
$tbl_name="teams"; // Table name 

// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or die("cannot connect"); 
mysql_select_db("$db_name")or die("cannot select DB");

// Retrieve data from database 
$sql="SELECT team FROM $tbl_name ORDER BY team";
$result=mysql_query($sql);
?>

  School <select name = "team">
<?php
// Start looping rows in mysql database.
while($rows=mysql_fetch_array($result)){
?>
  <option value = <?php echo $rows['team']; ?>><?php echo $rows['team']; ?></option> <?php
// close while loop 
}

// close connection 
mysql_close();
?> 		  
 									 </select>
  </p>
  <p>Coach <input type="text" name="coach" maxlength="20">
  Height <input type="text" name="height" maxlength="10">
  Weight <input type="text" name="weight" maxlength="10">
  </p>
   <p>Grade Point Average (GPA) <input type="text" name="gpa" maxlength="10">
  SAT Score <input type="text" name="sat" maxlength="5">
  </p>
  <p>
  Notable Academic and Athletic Achievments: (2500 Character Maximum) </p>
  
  
  <textarea name="other" rows="10" cols="50"> </textarea>
  <p><input type="submit" value="Submit"></p>
</form>
<?php
}
?>

 

 

*****

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.