I've been hired to create a web interface for the NEO Music Festivals.
I'm having a problem with the Accompanist script.  Part of
accompanist.php is supposed to query my database to see if there are any
accompanists already registered, and if there are, it't supposed to add
their names to a list box.  Below this list box is a button that says
"Modify" (in case they entered an accompanist's name incorrectly.  If
the Modify button is clicked, the form is supposed to send the
accompanist selected forward and call accompanist.php (itself) again
with the selected name in an Add Accompanist text box.  Unfortunately,
when I select a name from the list box and hit the Modify button,
although the name I selected appears in the appropriate text box, the
list box (list of registered accompanists) has no entries in it.  The
only reason I can see why this would be happening is because the script
was not re-querying the database to get the list of accompanists, but
I'm not sure why it's not requerying.  Here's my code:

<html>
<head>
<link rel="stylesheet" href="standard.css" type="text/css">
<title>2006 NEO Jr. High Music Festival - Accompanists</title>
</head>
<body>
<center>
<h1>2006 NEO Jr. High Music Festival</h1>
<h2>Accompanists</h2>
<br><br>
<?

include("schoolvariables.php");


//Now for some database stuff.
$db = "NEO_Music_Festival";
$user = "festival";
$pass = "466573746976616C";

//Let's connect
$link = mysql_connect ("localhost", $user, $pass);
if (!$link) die ("Could not connect to database server.");
mysql_select_db ($db, $link) or die ("Could not connect to database");

$accompanist = $_POST['accompanist'];
?>


<table border='1'>
<tr>
   <td>
      <form method='post' action='validateaccompanist.php'>
         <?
         print "Add Accompanist: <input type='text' name='accompanist'
value='$accompanist'>\n";
         include("schoolvariableshidden.php");
         ?>
         <input type='submit' value='Add'>
      </form>
   </td>
<tr>
<tr>
   <td align='center'>
      <form method='post' action='accompanist.php'>
         <?
         $result = mysql_query("SELECT name FROM ChoirAccompanist where
school_id='$schoolid'") or die("Could not find record.");
         if ($result != null)
         {
            print "ACCOMPANIST LIST<br>\n";
            print "<select name='accompanist' size='3'>\n";
            while($a_row = mysql_fetch_array($result, MYSQL_ASSOC))
            {
               foreach($a_row as $field)
               {
                  print "<option>$field</option>\n";
               } 
            }
            print "</select><br>\n";
            print "<input type='submit' value='Modify'>\n";
            print "</form>\n";
        }
        mysql_close($link);
        ?>
   </td>
</tr>
</table><br>





Community email addresses:
  Post message: php-list@yahoogroups.com
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to