Page 1 of 1

MySQL multiple <option value>

Posted: Thu Jan 24, 2008 7:40 am
by Todlerone
Hello everyone and again thank-you in advance for any suggestions to this post. I have recently successfully populated a form with a <option value> populated from MySQL database. All the dates from my database appear in the dropdown menu perfectly. My problem is that I need a second identical <option value> list with the same MySQL database "Date" information. I have tried the RESET(string) function but it doesn't seem to help. If the code is needed to help I can repost with it attached.

CHEERS :lol:

Re: MySQL multiple <option value>

Posted: Thu Jan 24, 2008 7:52 am
by VladSun
Use

Code: Select all

mysql_data_seek($sql_result, 0)
to "rewind" the result.

EDIT: Sorry - forgot to pass the resource.

Re: MySQL multiple <option value>

Posted: Thu Jan 24, 2008 7:59 am
by Todlerone
VladSun wrote:Use

Code: Select all

mysql_data_seek(0)
to "rewind" the result.
Thank-you for your quick response VladSun. I'll give it a try.

TTFN

Re: MySQL multiple <option value>

Posted: Thu Jan 24, 2008 11:51 am
by pickle
Why not just build both lists at the same time, in the same loop?

Re: MySQL multiple <option value>

Posted: Thu Jan 24, 2008 11:59 am
by VladSun
pickle wrote:Why not just build both lists at the same time, in the same loop?
It could not be done if it's in different FORMs e.g.

Another way to do this is to have a string containing the generated HTML in one loop .

Edit: In fact, I don't know what do you mean :) It could not be done in a different SELECTs either :)