i'm trying to use mysql_fetch_array($my_query_results) to list the available options in 3 separate html form <select> <option> pull-downs. only my first <select> pull down is showing my options-- the rest are empty.
can you see what i'm doing wrong?
$get_artist_ids = "select artist_id, artist_name from artist_info order by artist_name";
$get_artist_ids_res = mysql_query($get_artist_ids) or die(mysql_error());
$artist_ids = $get_artist_ids_res;
global $artist_ids;
// if LOGIC - CHECK FOR EXISTENCE OF ARTIST RECORDS.
// NO RESULTS = DISPLAY SORRY NO RECORDS.
// RECORDS = SHOW ARTIST_NAMES IN SELECTOR FORM.
}
if (mysql_num_rows($artist_ids) < 1) {
// NO RECORDS
$display_block .= "<p><em>Sorry, no artists exist to select!</em></p>
<p>Please <a href=\"addartist.php\">go add the Artists first</a>, then come back and
add the Concert Date</p>";
} else {
$display_block = "<h1>Add a Date:</h1>
<form method=\"post\" action=\"$_SERVER[PHP_SELF]\" >
<p><strong>Headliner:</strong>
<br />
<select name=\"artist_id1\">
<option value=\"\">-- Select Headliner --</option>";
while ($recs1 = mysql_fetch_array($artist_ids)) {
$artist_id1 = $recs1['artist_id'];
$artist_name1 = stripslashes($recs1['artist_name']);
$display_block .= "<option value=\"$artist_id1\">
$artist_name1</option></p>";
}
$display_block .= "<p><strong>First Supporting Act:</strong>
<br />
<input type=\"text\" name=\"artist_id2\" size=\"70\" maxlength=\"75\" />
</p>
<select name=\"artist_id2\">
<option value=\"\">-- Select First Support --</option>";
while ($recs2 = mysql_fetch_array($artist_ids)) {
$artist_id2 = $recs2['artist_id'];
$artist_name2 = stripslashes($recs2['artist_name']);
$display_block .= "<option value=\"$artist_id2\">
$artist_name2</option>";
}
$display_block .= "
<p><strong>Second Supporting Act:</strong>
<br />
<input type=\"text\" name=\"artist_id3\" size=\"70\" maxlength=\"75\" />
</p>
<select name=\"artist_id3\">
<option value=\"\">-- Select Second Support --</option>";
while ($recs3 = mysql_fetch_array($artist_ids)) {
$artist_id3 = $recs3['artist_id'];
$artist_name3 = stripslashes($recs3['artist_name']);
$display_block .= "<option value=\"$artist_id3\">
$artist_name3</option>";
}
$display_block .= "<p><strong>Show Date:</strong>
<br />
<input type=\"text\" name=\"show_date\" size=\"20\" maxlength=\"25\" value=\"yyyy-mm-dd\" />
</p>
<p><strong>Show Time:</strong>
<br />
<input type=\"text\" name=\"show_time\" size=\"20\" maxlength=\"25\" value=\"HH:MM\" />
</p>
<p><strong>Ticket Price Date of Show:</strong>
<br />
<input type=\"text\" name=\"tix_dos\" size=\"20\" maxlength=\"25\" value=\"yyyy-mm-dd\" />
</p>
<p><strong>Tickets in Advancee:</strong>
<br />
<input type=\"text\" name=\"tix_adv\" size=\"20\" maxlength=\"25\" value=\"HH:MM\" />
</p>
<p><strong>All Ages?</strong>
<br />
<input type=\"radio\" value=\"yes\" checked=\"checked\" /> yes
<input type=\"radio\" value=\"no\" /> no
</p>
<input type=\"hidden\" name=\"clear\" value=\"\" />
<p><strong>Alcohol Served?</strong>
<br />
<input type=\"radio\" value=\"yes\" checked=\"checked\" /> yes
<input type=\"radio\" value=\"no\" /> no
</p>
<p><strong>Concert Date Notes:</strong>
<br />
<textarea name=\"concert_notes\" cols=\"35\" rows=\"5\" wrap=\"virtual\">notes on this concert
</textarea>
</p>
<input type=\"hidden\" name=\"op\" value=\"add\" />
<p><input type=\"submit\" name=\"submit\" value=\"Add Date\" />
</p>
</form>";
}
thanks!!
also, my html <FORM> seems to be "out of whack" now-- i have definitely got something wrong here, but i can't see it yet.
WOW! i really have been looking at this code for TOO LONG!!
i needed to close my </select> statement, not to mention, i still have my <input type="text"... > where i meant to replace it w/ the <select><option> pull-downs!
yikes!