PDA

View Full Version : makechoosercode question


DiscussAnything
11-17-2005, 07:35 PM
This is for vb 2.3.x in case it matters.

I have 2 tables, one with the id's and values for the dropdown entries. The other is the table the value is saved to.

The table that populates the dropdown has fields 'id' and 'name' The choosercode is as follows:


makechoosercode("State/Country","state","states", $primoaddy['state']);


state is the field it is being saved to
states is the table it gets the values from

So far so good, this part works. It does save the 'id' to the target table though, and not the name of the state/country. But I'm guessing that's still how it's supposed to be.

Next part is where I'm confused. This is where I compile a list of members' addresses (the ones that put it in anyway). The search option it looks like this:

doformheader("address","findstate");
maketableheader("Find Member - By State");
makechoosercode("State:","state","states",-1,"Any");

It's getting the names just fine and populates the search-dropdown as expected.

BUT, when the results come up, it shows the state id, and not the state name. I'm displaying $fas[state] .

The question is: On the results, is there any way to have the name field show up instead of the id? I can't imagine I did anything wrong particularly since everything else works as expected. So am I doing something wrong, or is there any way I can have it show the results that actually mean something, rather than just a number?

Thanks in advance :)

Marco van Herwaarden
11-17-2005, 07:51 PM
$states["$fas[state]"] maybe?

DiscussAnything
11-17-2005, 09:27 PM
That just gives errors. Without quotes or with single quotes it still doesn't like it :(

Guess one option would be to just replace the id's with actual state names and countries, right? As long as it's unique there shouldn't be a problem doing that... Nothing else uses that table and i'm the only one populating it, so...

that would work right?

Marco van Herwaarden
11-18-2005, 05:08 AM
Sorry i have no knowledge of vB2 and without seeing more of your code (where is $fas defined) i cant help you more.

DiscussAnything
11-18-2005, 11:39 PM
Dank je Marco, but I figured it out. By changing the values in the tables I was able to get the results I was looking for, without too many php changes.

Doei :)