Originally Said By: Ray Borduin
That means that the child recordset isn't inside of the repeat region or isn't filtered by the parent recordset properly. I'd have to see a copy of the page to know which.
The parent query is
===============
<?php
$booksections = new WA_MySQLi_RS("booksections",$hadithbd,0);
$booksections->setQuery("SELECT books_type.btypeID, books_type.bookCat, Count(books_name.booktype) AS Countbooktype, books_name.booktype FROM books_type LEFT OUTER JOIN books_name ON books_type.btypeID = books_name.booktype WHERE books_name.Active = 1 GROUP BY books_name.booktype ORDER BY books_name.booktype ASC");
$booksections->execute();
?>
The child query is
=============
<?php
$booksname = new WA_MySQLi_RS("booksname",$hadithbd,0);
$booksname->setQuery("SELECT books_name.bookID, books_name.booktype, books_name.Book_nameBD, book_writter.writter_nameBN FROM books_name LEFT OUTER JOIN book_writter ON books_name.writterID = book_writter.wrID WHERE books_name.booktype = ? ORDER BY books_name.booktype ASC, books_name.bookID ASC");
$booksname->bindParam("i", "".($booksections->getColumnVal("booktype")) ."", "-1"); //WAQB_Param1
$booksname->execute();
?>
The body is
=========
<div class="row">
<?php
$wa_startindex = 0;
while(!$booksections->atEnd()) {
$wa_startindex = $booksections->Index;
?>
<div class="list-group col-sm">
<div class="list-group-item list-group-item-action active">
<span class="badge badge-pill badge-light float-left"> <i class="fas fa-box-open"></i> <?php echo($booksections->getColumnVal("btypeID")); ?> </span>
<span class="text-center text-white ml-3"><?php echo($booksections->getColumnVal("bookCat")); ?></span> <span class="badge badge-warning text-white float-right"><?php echo($booksections->getColumnVal("Countbooktype")); ?></span>
<?php
$wa_startindex = 0;
while(!$booksname->atEnd()) {
$wa_startindex = $booksname->Index;
?>
<a href="#" class="list-group-item list-group-item-action"><?php echo($booksname->getColumnVal("Book_nameBD")); ?> - <?php echo($booksname->getColumnVal("writter_nameBN")); ?></a>
</div> <?php
$booksname->moveNext();
}
$booksname->moveFirst(); //return RS to first record
unset($wa_startindex);
unset($wa_repeatcount);
?>
<?php
$booksections->moveNext();
}
$booksections->moveFirst(); //return RS to first record
unset($wa_startindex);
unset($wa_repeatcount);
?>
</div>
</div>