This time I have a real question that I need help with.  I am not
sure why something is not working the way I intend it.  This is most likely
a mistake in my understanding, but here goes...
        I have a section of code that populates a dropdown list with the
results of a query on a database table.  This works perfectly, and is
exactly what I want.  My problem is that I need to use this same data to
populate a second dropdown list, and the second list is empty.  I thought
that by setting another variable equal to the original prior to it being
processed in a loop which populates the first drop down I would be OK, but
this doesn't seem to do the trick for me.  Here is the section of code that
I am working with.  Thanks in advance.

mysql_select_db($database, $Test);
$query_SA = "SELECT sbcuid FROM contacts_sa";
$SA = mysql_query($query_SA, $Test) or die(mysql_error());
$PASS = $SA;
$row_SA = mysql_fetch_assoc($SA);
$totalRows_SA = mysql_num_rows($SA);
$sa_list = "<select size=\"1\" name=\"sa\">\n";
$sa_list .= "<option>SA UID</option>\n";
while($name = mysql_fetch_row($SA)) {
  $sa_list .= "<option>$name[0]</option>\n";
}
$passed = "<select size=\"1\" name=\"pass\">\n";
$passed .= "<option>SA UID</option>\n";
$passed .= "<option>------</option>\n";
while($name = mysql_fetch_row($PASS)) {
  $passed .= "<option>$name[0]</option>\n";
}

        I understand that some of this is unnecessary, but I am using DW MX
and do not believe that the extra variable definitions hurt anything.  I
might find a use for the row variables down the road anyway.  Correct me if
I am wrong though, that these are actual database queries and at least
commenting them out could help performance?  That is a secondary question,
but thanks agian.

Scott Nipp
Phone:  (214) 858-1289
E-mail:  [EMAIL PROTECTED]
Web:  http:\\ldsa.sbcld.sbc.com



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to