PDA

View Full Version : Result only show 1 record - hack of memberlist.php


stryka
02-15-2003, 02:27 PM
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)


$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
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!