vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Dropdown Menus 'selected="selected"' (https://vborg.vbsupport.ru/showthread.php?t=268949)

nhawk 08-23-2011 01:01 PM

There is something you should know..

After you parse through the data returned by getCountries once, you can't parse the same query results a second time. The pointers are already set to the end of the data after the first while { } loop and the pointer either needs to be reset or the data stored in an array for future use during the first parse.

Iain M 08-23-2011 01:13 PM

Thanks Kevin
PHP Code:

$countryOptions ''

after the render worked.

Thank you nhawk for that explanation =]

nhawk 08-23-2011 01:16 PM

Quote:

Originally Posted by kh99 (Post 2236768)
But you're getting a list of services, each with a list of countries, so it has to be doing both loops, right? It seems like it's just the test for the selected one that isn't working.

Oh, I think I know - you have to repeat the 'countries' query each time. Try putting


PHP Code:

$db->data_seek($getCountries0); 

right after the 'editservicebit' template render.

LOL, it's too early. KH99 already caught that here :)

I need.... more.... coffee :D

kh99 08-23-2011 01:22 PM

Quote:

Originally Posted by nhawk (Post 2236999)
LOL, it's too early. KH99 already caught that here :)

I need.... more.... coffee :D

Yeah, but I'm slightly embarrassed that I didn't notice that right off. To be honest I didn't even know that you could get the results of two queries at the same time like that.

Marco64Th 08-24-2011 03:46 AM

A static list like the countries should really just go into the datastore as a serialized array. Just 1 time read them from the datastore (using the standard vB functions) into the $vbulletin object and you're done.

Iain M 08-24-2011 11:28 AM

I will look into using the datastore. Thank you Marco.


All times are GMT. The time now is 02:07 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01092 seconds
  • Memory Usage 1,727KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete