vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   'while' not echoing data it was designed for (https://vborg.vbsupport.ru/showthread.php?t=72719)

sabret00the 12-10-2004 12:09 PM

'while' not echoing data it was designed for
 
going into the while i know it exists but coming out for some reason i can't get the data

PHP Code:

// ###################### extracts newest groups for main grps page
             
$grps_newest $DB_site->query("
                 SELECT grps.groupid, grps.title, grps.description, grps.approved, grps.leaderid, user.username
                 FROM " 
TABLE_PREFIX "grps
                 LEFT JOIN user ON (user.userid = grps.leaderid)
                 
$group
                 
$order
                 
$limit 
             "
);
 
             if (!
$DB_site->num_rows($grps_newest))
             { 
// no groups, this becomes useless after the first group gets created
                         
$grps_newestbits .= "<tr><td class=\"alt1\" align=\"center\">no groups found at this time</td></tr>";
             }
             else
             { 
// display the information
                 
while ($grps_newestinfo $DB_site->fetch_array($grps_newest))
                 {
                     
$grps_newestinfo['title'] = stripslashes($grps_newestinfo['title']);
                     
$grps_newestinfo['description'] = nl2br(stripslashes($grps_newestinfo['description']));
                     
extract($grps_newestinfo);
                     
                 } 
//now echo the date into the template
 
                  
eval('$grps_newestbits .= "' fetch_template("groups_newestbits") . '";');
             } 

what am i doing wrong?

i just want to have $grps_newestinfo[title],$grps_newestinfo[description] and $grps_newestinfo[username] appear in a template but i can't get em to appear at all for some reason.

sabret00the 12-10-2004 03:34 PM

*bump* due to the fact it's put a halt in my coding and thus i'm twiddling my thumbs :(

Colin F 12-10-2004 03:48 PM

Quote:

Originally Posted by sabret00the
*bump* due to the fact it's put a halt in my coding and thus i'm twiddling my thumbs :(

no errors in the templatename (bits instead of bit for example)?

AN-net 12-10-2004 03:50 PM

try putting the eval and the fetch template inside the while statement;)

sabret00the 12-10-2004 06:03 PM

Quote:

Originally Posted by Colin F
no errors in the templatename (bits instead of bit for example)?

yup that was fine :(

Quote:

Originally Posted by AN-net
try putting the eval and the fetch template inside the while statement ;)

you are a hero :)


All times are GMT. The time now is 05:02 AM.

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.01141 seconds
  • Memory Usage 1,732KB
  • 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
  • (1)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete