Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 11-17-2005, 07:35 PM
DiscussAnything DiscussAnything is offline
 
Join Date: Jan 2002
Posts: 131
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default makechoosercode question

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:

PHP Code:
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:

PHP Code:
  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
Reply With Quote
  #2  
Old 11-17-2005, 07:51 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

$states["$fas[state]"] maybe?
Reply With Quote
  #3  
Old 11-17-2005, 09:27 PM
DiscussAnything DiscussAnything is offline
 
Join Date: Jan 2002
Posts: 131
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #4  
Old 11-18-2005, 05:08 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry i have no knowledge of vB2 and without seeing more of your code (where is $fas defined) i cant help you more.
Reply With Quote
  #5  
Old 11-18-2005, 11:39 PM
DiscussAnything DiscussAnything is offline
 
Join Date: Jan 2002
Posts: 131
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:09 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04529 seconds
  • Memory Usage 2,201KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete