Jump to content

join subcategories problem


vinpkl

Recommended Posts

Hi all

 

I want to show subcategories on only the selected dealer

But the below code is showing subcategories on all dealers.
 

    »  Blackberry (3)

        »  Battery (2)

    »  Samsung (1)

        »  Battery (1)

If Blackberry dealer is selected then only its subcategories should be visible.

Samsung subcategories should be hidden.

<?php

    $qry_sub="select distinct s.subcid, s.subname from subcategories as s

    INNER JOIN

    producttable as p

    ON

    s.subcid = p.subcatg and p.dealerid = ".$dealer_id." and p.status='Y'";

    //echo $qry_sub;

    echo "<ul>";

    $result_sub=mysql_query($qry_sub);


while($row_sub=mysql_fetch_array($result_sub))

{

    echo "<li></li>";

}

    echo "</ul>";

?>

Thanks

Vineet

Link to comment
https://forums.phpfreaks.com/topic/296416-join-subcategories-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.