@kanchan186 stucked at the same views for days now, you should learn how to debug your code my friend.
If you don't have an error, but you see the view, and there are no results than obviously there is either no data in your database or your query is wrong.
public function show2(Request $request)
{
dd($request->all()); // remove this line to see your view
$result=DB::table('prod_cats')
->join('products','products.p_id','=','prod_cats.pc_id')
->join('categories','categories.c_id','=','prod_cats.pc_id')
->select('prod_cats.pc_id','products.p_id','products.p_name','categories.c_id','categories.c_name')->get();
dd($result); // print the result here and make sure that there is data coming from your query.
return view('pcview',compact('result'));
}
In your query above what I've noticed is you use prod_cats.pc_id for both getting the products and the categories. Is that maybe wrong? Maybe you need to get the categories from a column in the products table instead..
maybe you need this line?
->join('categories','categories.c_id','=','products.c_id')