当前位置: 首页>>代码示例>>PHP>>正文


PHP Mysql::GetData方法代码示例

本文整理汇总了PHP中Mysql::GetData方法的典型用法代码示例。如果您正苦于以下问题:PHP Mysql::GetData方法的具体用法?PHP Mysql::GetData怎么用?PHP Mysql::GetData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mysql的用法示例。


在下文中一共展示了Mysql::GetData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Mysql

            $Mysql = new Mysql(DB_NAME);
            $Mysql->doQuery($SQL);
            while ($obj = $Mysql->GetData()) {
                if ($SecondCat[1] == $obj->catid) {
                    $class = "class='cur-menu'";
                } else {
                    $class = "";
                }
                echo "<li " . $class . "><a href='/index.php?gOo=goods_category.dwt&gcat=" . $obj->catid . "' >" . $obj->cat . "</li>\n";
                //建立三级目录
                if ($_GET['pid'] == $obj->catid) {
                    echo "<ul id='catmenu'>\n";
                    $SQL2 = "SELECT   catid,offerid ,cat  FROM " . CAT_TB . " WHERE pid=" . $obj->catid;
                    $Mysql2 = new Mysql(DB_NAME);
                    $Mysql2->doQuery($SQL2);
                    while ($obj2 = $Mysql2->GetData()) {
                        if ($_GET['pid'] == $obj2->catid) {
                            $class = "class='cur-menu'";
                        } else {
                            $class = "";
                        }
                        echo "<li " . $class . "><a href='/index.php?gOo=goods_category.dwt&gcat=" . $obj2->catid . "&sub=" . $obj2->catid . "' >" . $obj2->cat . "</li>\n";
                    }
                    echo "</ul>";
                }
            }
        } else {
        }
    }
}
//end of if pid
开发者ID:dalinhuang,项目名称:shopexts,代码行数:31,代码来源:cat2.php

示例2: Mysql

    $Mysql2 = new Mysql(DB_NAME);
    $Mysql2->doQuery($SQL2);
    $curl .= "<ul  id='menu-sub-" . $obj->cat_id . "' class='childli' style='display:none;'>\n";
    $ulid_list .= $obj->cat_id . ",";
    while ($obj2 = $Mysql2->GetData()) {
        $curl .= "<li   class='class-2'  id='menu-a-" . $obj->cat_id . "' >";
        $curl .= "<a  id='li-a-" . $obj2->cat_id . "' href='" . HOME_URL . "/index.php?gOo=goods_category.dwt&gcat=" . $obj2->cat_id . "' >" . $obj2->cat . "</a>";
    }
    $curl .= "</ul>";
    $curl .= "</li>\n";
    $lastpid = $obj->pid;
    $i++;
}
$curl .= "<li class='menu-bt'></li>";
$curl .= "</ul>";
echo $curl;
if ($_GET['goodsid'] != '') {
    $SQL = "SELECT cat_id  FROM " . GOODS_TB . " WHERE gid=" . $_GET['goodsid'];
    $Mysql = new Mysql(DB_NAME);
    $Mysql->doQuery($SQL);
    $obj = $Mysql->GetData();
    $goodscat = $obj->cat_id;
    $SQL = "SELECT pid  FROM " . NEW_CAT_TB . " WHERE cat_id=" . $goodscat . "  ORDER BY catord ASC";
    $Mysql = new Mysql(DB_NAME);
    $Mysql->doQuery($SQL);
    $obj = $Mysql->GetData();
    $pid = $obj->pid;
    echo "<div id='cat_ul_list' style='display:none'>" . $pid . "</div>";
}
echo "<div id='ul_list' style='display:none'>" . $ulid_list . "</div>";
echo "<div id='goodscat' style='display:none'>" . $goodscat . "</div>";
开发者ID:dalinhuang,项目名称:shopexts,代码行数:31,代码来源:cat-js.php


注:本文中的Mysql::GetData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。