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


PHP DbConnect::selectByOpenId方法代码示例

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


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

示例1:

    echo "<div class=\"box\" style=\" position:absolute; background:#ffd700; top:56%; right:26%; boder:1px solid;\" onclick=\" location.href='myorder.php';\">查看已下订单</div>";
    echo "<div class=\"box\" style=\" position:absolute; background:#ffd700; top:71%; left:1%; boder:1px solid;\" onclick=\" location.href='comments.php?username={$username}'; \">用户评价</div>";
    if ($username == 'oZUx9jm9rFmgf--TRVFoRMFpkzXY' || $username == 'oZUx9jkw7wFL1f8rX5UOdoVgmF4k') {
        echo "<div class=\"box\" style=\" position:absolute; background:#000000; top:71%; right:1%; boder:1px solid;\" onclick=\" location.href='changeStatus.php'; \">改变平台运营状态</div>";
    }
    //echo "<div class=\"box\" style=\" position:absolute; background:#ffd700; top:71%; left:1%; boder:1px solid;\" onclick=\" location.href='packageOrder.php';\">套餐界面</div>";
    //echo "<div class=\"box\" style=\" position:absolute; background:#ffd700; top:71%; left:1%; boder:1px solid;\" onclick=\" location.href='myorder.php';\">订餐提醒</div>";
    //echo "<div class=\"box\" style=\" position:absolute; background:#ffd700; top:71%; right:26%; boder:1px solid;\" onclick=\" location.href='NewPackage.php';\">创建套餐</div>";
} else {
    if (DbConnect::queryByUsername($username, $con) && !isset($_GET['action'])) {
        $row = DbConnect::selectByOpenId("name", $username);
        echo "<div style=\" -moz-border-radius:30px;-webkit-border-radius:30px;border-radius: 5px;position:absolute;color:#000;background:#ffffff;bottom:0; width:97%; height:80px;\">";
        echo "个人信息:<br/>" . $row['name'];
        echo "</br>";
        echo "默认地址: ";
        $row = DbConnect::selectByOpenId("apartment, number, telephone", $username);
        echo $row['apartment'] . "楼" . $row['number'];
        echo "</br>";
        echo "手机号:";
        echo $row['telephone'];
        echo "</div>";
        echo "<div class=\"box\" style=\" position:absolute; background:rgb(255,0,0);  top:56%;left:1%;  boder:1px solid;\" onclick=\" location.href='order.php?rest=1';\">开始点餐</div>";
        echo "<div class=\"box\" style=\" position:absolute;background:#66cc00;  top:56%;  right:1%; boder:1px solid;\"onclick=\" location.href='modify.php';\">修改送餐地址</div>";
        //echo "<div class=\"box\" style=\" position:absolute; background:#0066ff;   top:56%; left:26% ;boder:1px solid;\" onclick=\" location.href='introduction.php';\">使用说明</div>";
        echo "<div class=\"box\" style=\" position:absolute; background:#ffd700;  top:56%; left:26%; boder:1px solid;\" onclick=\" location.href='myorder.php';\">查看已下订单</div>";
        echo "<div class=\"box\" style=\" position:absolute; background:#ffd700; top:56%; right:26%; boder:1px solid;\" onclick=\" location.href='comments.php?username={$username}'; \">用户评价</div>";
        //echo "<div class=\"box\" style=\" position:absolute; background:#ffd700; top:71%; left:1%; boder:1px solid;\" onclick=\" location.href='packageOrder.php';\">套餐界面</div>";
    } else {
        //进入注册页面modify.php
        echo "<div style=\" -moz-border-radius:30px;-webkit-border-radius:30px;border-radius: 5px;position:absolute;color:#000;background:#ffffff;bottom:0; width:97%; height:80px;\">";
        echo "您好,点餐前请先输入订餐信息,输入前可以查看菜单,但不能点餐";
开发者ID:SebastianElvis,项目名称:mtcds,代码行数:31,代码来源:alldishes.php

示例2: mysql_select_db

<?php

//echo $_GET['username'];
require_once './function/DbConnect.php';
$con = DbConnect::connection();
//
mysql_select_db("app_mtcds", $con);
$username = $_GET['username'];
$result = DbConnect::selectByOpenId("*", $username);
$datetime = date("Y-m-d H:i:s");
$words = $_POST['words'];
$sql = "INSERT INTO comments VALUES(\"{$result['name']}\",\"{$result['apartment']}\",\"{$words}\",\"0\",\"{$datetime}\")";
$insert = mysql_query($sql);
if ($insert) {
    echo "评价发表成功!";
} else {
    echo mysql_error();
}
$updatecomment = "UPDATE user SET comment = 0 WHERE username= \"{$username}\" ";
//echo $updatecomment;//
mysql_query($updatecomment);
/*
$querycomment="SELECT comment FROM user WHERE username=\"$username\"";//
echo $querycomment;//
$result=mysql_fetch_array(mysql_query($querycomment));//
echo $result['comment'];//
echo mysql_error();//
*/
开发者ID:SebastianElvis,项目名称:mtcds,代码行数:28,代码来源:newcomments.php


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