For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > September 2005 > PHP question









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author PHP question
reclmaples

2005-09-18, 4:11 am

I'm not sure if this is the correct distro, if not please let me know which
one I should send this to.

I am having an issue that I can't figure out. I have a table that has a
HOME and AWAY fields in it. I want to make those two fields (the result
will be one record in HOME and one record in AWAY per ID).

my sql looks like this:

select ID,HOME,AWAY where WEEK = '$WEEK' and USERNAME = '$username'

This loops to get all ws and usernames in the table. Can anyone help me
with the php code. My problem is, if I have them looping through the users
in the table, how do I keep a variable for each record that is returned.

i.e

I have PIT in the HOME field and GIA in the AWAY field for WEEK = 1 with
username a blah (this would have an ID of 1)

I want PIT and GIA in the same dropdown, but also for username blah and
WEEK =1 (ID = 2) I have ATL in the HOME and PHI in the AWAY (the while loop
does this for me) How do I keep the variable for the ID =1 equal to what I
pick from that dropdown and how do I keep the value from the second drop
down. Can you help? I'm not sure if this is explained well enough, let me
know if you need more details.

Thanks
-Rich
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com