1
遅すぎるが、それは負荷に時間がかかりすぎる:ビルメニューは、私は以下のコードを使用して動的メニューを作成しようとしています
<?php
ob_start();
include ('admin/db/db.php');
echo '<li><a href="#">Exports</a>';
$sql3 = "SELECT * FROM category_master where type = 'Export' order by sequence asc ";
$result3 = mysqli_query($connection, $sql3);
if (mysqli_num_rows($result3) > 0)
{
// output data of each row
echo '<ul>';
while ($userrows3 = mysqli_fetch_assoc($result3))
{
$cid = $userrows3['product_category_id'];
$cname = $userrows3['category_name'];
echo '<li><a href="category_details.php?cid=' . $cid . '&cname=' . $cname . '">' . $cname . '</a>';
$sql4 = "SELECT group_product FROM products,category_master,cat_wise_pro where category_master.product_category_id = cat_wise_pro.category_id and products.product_id = cat_wise_pro.product_id and category_master.product_category_id =$cid group by products.group_product ";
$result4 = mysqli_query($connection, $sql4);
if (mysqli_num_rows($result4) > 0)
{
// output data of each row
echo '<ul>';
while ($userrows4 = mysqli_fetch_assoc($result4))
{
$gname = $userrows4['group_product'];
echo '<li><a href="product_details.php?gname=' . $gname . '">' . $gname . '</a>';
$sql5 = "SELECT product FROM products,group_products where products.group_product = group_products.group_product and products.group_product = '$gname'";
$result5 = mysqli_query($connection, $sql5);
if (mysqli_num_rows($result5) > 0)
{
// output data of each row
echo '<ul>';
while ($userrows5 = mysqli_fetch_assoc($result5))
{
$pname = $userrows5['product'];
echo '<li><a href="product_info.php?pname=' . $pname . '">' . $pname . '</a>';
}
echo '</ul>';
}
}
echo '</ul>';
}
}
}
echo '</ul>';
?>
は、私が代わりにビューを使用する必要がありますテーブル... find below the view i create
どのようにすればいいですか?あなたのコードは何