close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Query with advance Grouping

Thread began 1/16/2017 10:58 am by danielsebas | Last modified 1/17/2017 1:56 pm by danielsebas | 292 views | 4 replies

danielsebas

Thank you Ray, I did this, but the information of the products is repeating the same for all categories:

<?php
$breadcrumbs = new WA_MySQLi_RS("breadcrumbs",$conn_mysqli_base,0);
$breadcrumbs->setQuery("SELECT * FROM subcategoria, categoria WHERE categoria.categoriaID = subcategoria.subcatCATID AND subcategoria.subcatCATID = ?");
$breadcrumbs->bindParam("i", "".$_GET['cat'] ."", "-1"); //colname
$breadcrumbs->execute();
?>
<?php
$fotos = new WA_MySQLi_RS("fotos",$conn_mysqli_base,0);
$fotos->setQuery("SELECT fotos.fotosID, fotos.fotosNOM, fotos.fotosADD, fotos.fotosSUBCAT, fotos.fotosLARGOID, fotos.fotosCABID, fotos.fotosORD, largo.largoID, largo.largoDES, categoria.categoriaID, categoria.categoriaNOM, cabeza.cabezaID, cabeza.cabezaDES, subcategoria.subcatID, subcategoria.subcatNOM, subcategoria.subcatCATID FROM (((fotos LEFT JOIN largo ON fotos.fotosLARGOID = largo.largoID) LEFT JOIN cabeza ON fotos.fotosCABID = cabeza.cabezaID) LEFT JOIN subcategoria ON fotos.fotosSUBCAT = subcategoria.subcatID) LEFT JOIN categoria ON subcategoria.subcatCATID = categoria.categoriaID WHERE subcategoria.subcatID = ? ORDER BY fotos.fotosORD ASC");
$fotos->bindParam("i", "".($breadcrumbs->getColumnVal("subcatID")) ."", "-1"); //colname_1
$fotos->execute();
?>



<?php
while(!$breadcrumbs->atEnd()) {
?>
<div class="row">
<div class="col-md-12">
<div class="subcat-titulo">
<h4><?php echo($breadcrumbs->getColumnVal("subcatNOM")); ?></h4>
</div>
</div>
<?php
while(!$fotos->atEnd()) {
?>
<div class="col-sm-6 col-md-4">
<div class="thumbnail"> <img class="img-responsive center-block" src="media/gallery/<?php echo($fotos->getColumnVal("categoriaID")); ?>/<?php echo($fotos->getColumnVal("subcatID")); ?>/<?php echo($fotos->getColumnVal("fotosADD")); ?>" alt=""/>
<div class="caption caption_prod"><?php echo($fotos->getColumnVal("fotosNOM")); ?></div>
</div>
</div>
<?php
$fotos->moveNext();
}
$fotos->moveFirst(); //return RS to first record
?>
</div>
<?php
$breadcrumbs->moveNext();
}
$breadcrumbs->moveFirst(); //return RS to first record
?>

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...