Hi All,
I have a page with two forms. Both forms have drop-down option
lists that are populated by a the same query. The query and
db connection are all done before either form is introduced
(this is the select statement, mysql_pconnect(), mysql_select_db(),
and mysql_query()).
I am using a while loop to build the options. The loop "engine"
is mysql_fetch_object(), which writes out the values inside of
option tags.
Everything works fine the first time around, but when I call
the query result for the second time, it's as if there are no
rows to return so nothing is written out. No errors are being
thrown.
I know the resultant query object still exists, because I can
access some of its properties (e.g.: mysql_num_rows has
a value when it is called at this same place in the code as the
second loop set).
One caveat: This code DOES work if, just before the second call
to build the second set of options, I resend the query (again using
mysql_query()).
I would think that looping on the object the first time should only
read from it and not otherwise change it. Why am I unable to reuse
this object in a second mysql_fetch_object() without resending
the query?
I have tried distinguishing the variable names that I set the results to for
each loop and this doesn't seem to make a difference.
Running PHP 4.0.4, MySQL 3.23.22-beta on Win2K.
Thanks, George
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]