MySQL multiple <option value>

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Todlerone
Forum Commoner
Posts: 96
Joined: Sun Oct 28, 2007 10:20 pm
Location: Hamilton, Ontario, Canada

MySQL multiple <option value>

Post 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:
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: MySQL multiple <option value>

Post by VladSun »

Use

Code: Select all

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

EDIT: Sorry - forgot to pass the resource.
Last edited by VladSun on Thu Jan 24, 2008 8:03 am, edited 1 time in total.
There are 10 types of people in this world, those who understand binary and those who don't
Todlerone
Forum Commoner
Posts: 96
Joined: Sun Oct 28, 2007 10:20 pm
Location: Hamilton, Ontario, Canada

Re: MySQL multiple <option value>

Post 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
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: MySQL multiple <option value>

Post by pickle »

Why not just build both lists at the same time, in the same loop?
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: MySQL multiple <option value>

Post 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 :)
There are 10 types of people in this world, those who understand binary and those who don't
Post Reply