close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Having problem to show Master and child table data

Thread began 4/15/2020 2:12 am by Rokon | Last modified 4/15/2020 10:31 am by Rokon | 787 views | 6 replies

Rokon

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>

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...