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

Reply
 
Thread Tools Display Modes
  #1  
Old 09-28-2001, 05:17 AM
TWTCommish's Avatar
TWTCommish TWTCommish is offline
 
Join Date: Oct 2001
Location: Pittsburgh, PA, USA
Posts: 783
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm working on a hack, and I am using code with the below format (in my main vB directory)...however, the query only produces one row, even though running it manually produces more than that. It seems as if it's not running through the loop more than once...any idea on what might be wrong with it? Thanks in advance.

PHP Code:
<?php
require("./global.php");

$forumlist $DB_site->query("SELECT * FROM forum WHERE displayorder != '0' AND active = '1' ORDER BY parentid, displayorder");
  while (
$forum $DB_site->fetch_array($forumlist)) {
    
// do stuff
  
}
$DB_site->free_result($forumlist);
unset(
$forum);
Could it be that those variables ($forumlist, $forum) are conflicting with some others in use in the global.php file?
Reply With Quote
  #2  
Old 09-28-2001, 05:32 AM
JamesUS's Avatar
JamesUS JamesUS is offline
 
Join Date: Oct 2001
Posts: 347
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quite possibly. Try unsetting them both before your code:

PHP Code:
<?php
require("./global.php");

unset(
$forumlist);
unset(
$forum);
//your code here
Reply With Quote
  #3  
Old 09-28-2001, 05:38 AM
TWTCommish's Avatar
TWTCommish TWTCommish is offline
 
Join Date: Oct 2001
Location: Pittsburgh, PA, USA
Posts: 783
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Good idea. Just tried it, but still no loopage.
Reply With Quote
  #4  
Old 09-28-2001, 08:32 PM
TWTCommish's Avatar
TWTCommish TWTCommish is offline
 
Join Date: Oct 2001
Location: Pittsburgh, PA, USA
Posts: 783
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Alright, if someone can help me figure out what's wrong with this (seemingly) simple block of code, I'll give 'em a link in the footer of every page on my site (MovieForums.com) for 2 weeks (probably more...I'm lazy about taking stuff like that down). The site gets 150-200 posts a day on average.

Any assistance is appreciated!
Reply With Quote
  #5  
Old 09-28-2001, 08:36 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Will you put *another* link to Israel.com if I help you?

j/k, I can't really understand why it won't loop.
Reply With Quote
  #6  
Old 09-28-2001, 09:04 PM
TWTCommish's Avatar
TWTCommish TWTCommish is offline
 
Join Date: Oct 2001
Location: Pittsburgh, PA, USA
Posts: 783
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

LOL...sure I would! Hehe. Yeah, I'm stumped to. It's really a very simple block of code. I ran the query elsewhere and it does indeed produce more than one record...the one that the script does spit out (by itself) each time is the last one returned when I run the query in phpMyAdmin...dunno if that's useful, though.
Reply With Quote
  #7  
Old 09-28-2001, 11:45 PM
Dolby's Avatar
Dolby Dolby is offline
 
Join Date: Oct 2001
Location: Wisconsin
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have a script that lists stuff... Look at this and insert your stuff and it should work for you.


PHP Code:
// echo "html that doesnt repeat";
$result=mysql_query("SELECT * FROM user where (usergroupid = '6' OR usergroupid ='8' OR usergroupid ='9') AND r_class = 'bard' order by username") or die ("Query Failed:".mysql_error());
while (
$row mysql_fetch_row($result)) {
    echo 
"//html that repeats... <tr><td width=200><a href=rprofile.php?ruser=$row[2]>$row[2] $row[42]</a></td><td>Lvl:$row[43]</td><td>$row[44]</td><td width=100>$row[46]</td></tr>
<tr><td colspan=4><hr size=1 width=100%></td></tr>"
;
}
// echo "html that doesnt repeat"; 
Reply With Quote
  #8  
Old 09-29-2001, 12:46 AM
TWTCommish's Avatar
TWTCommish TWTCommish is offline
 
Join Date: Oct 2001
Location: Pittsburgh, PA, USA
Posts: 783
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, I have no problem grabbing data...I'm just sticking with vB's functions, because it's cleaner that way. I'm wondering if there is some quirk in the DB_site class that's preventing this loop from running properly.
Reply With Quote
  #9  
Old 09-29-2001, 07:11 AM
JamesUS's Avatar
JamesUS JamesUS is offline
 
Join Date: Oct 2001
Posts: 347
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Which version are you on Chris?
Reply With Quote
  #10  
Old 09-29-2001, 11:56 AM
TWTCommish's Avatar
TWTCommish TWTCommish is offline
 
Join Date: Oct 2001
Location: Pittsburgh, PA, USA
Posts: 783
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nope...this is with 2.0.3.
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 09:48 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.04844 seconds
  • Memory Usage 2,264KB
  • 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
  • (3)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete