vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Result only show 1 record - hack of memberlist.php (https://vborg.vbsupport.ru/showthread.php?t=48940)

stryka 02-15-2003 02:27 PM

Result only show 1 record - hack of memberlist.php
 
I hacked up memberlist.php to create my own php file that pulls multiple records from a custom table...

currently -> the file only shows 1 record... which is the first record of each page... although i indicate to show atleast 10 records @ a time... can you tell me what is wrong with the "WHILE" statement or if there is anything else i should look for... assume that other variables are set just like the memberlist.php file...

the only way it shows more than one record is if i add an echo after the 'while' statement... (see red entry)

Quote:

$query1=$DB_site->query("SELECT *
FROM DB
WHERE $condition
ORDER BY $orderby $direction
LIMIT ".($limitlower-1).",$perpage");

$counter=0;

while ($queryinfo=$DB_site->fetch_array($query1) and $counter++<$perpage)

{
echo $counter;
if ($queryinfo[name]) {
eval("\$queryinfo[namelink] = \"".gettemplate("name_postbit")."\";");
} else {
$queryinfo[name]="&nbsp;";
}

eval("\$show_namelist .= \"".gettemplate("show_namelist ")."\";");
eval("dooutput(\"".gettemplate("show_namelist")."\ ");");
} // end while


Xenon 02-15-2003 04:15 PM

Code:

eval("dooutput(\"".gettemplate("show_namelist")."\");");
is inside your whileloop but should be outside

stryka 02-20-2003 03:31 PM

Just a followup...

Thanx... that did the trick... but when I worked further I noticed that my $TotalPages variable returned 27 pages in the $pageNave template...

I should only have 5-6 pages returned... i even test out my sql in PHPMyADMIN and I only get 5-6... i verify that the limit variables are correct... any suggestions on what to check?

Thanx!


All times are GMT. The time now is 12:30 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.01464 seconds
  • Memory Usage 1,714KB
  • 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_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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