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


PHP DB_Functions::getUid方法代码示例

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


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

示例1:

         $response["user"]["email"] = $user["email"];
         $response["user"]["created_at"] = $user["created_at"];
         $response["user"]["updated_at"] = $user["updated_at"];
         echo json_encode($response);
     } else {
         // user not found
         // echo json with error = 1
         $response["error"] = 1;
         $response["error_msg"] = "Incorrect email or password!";
         echo json_encode($response);
     }
 } else {
     if ($tag == 'sendRequest') {
         $email = $_POST['fromemail'];
         $toEmail = $_POST['toemail'];
         $fromid = $db->getUid($email);
         $toid = $db->getUid($toEmail);
         $relation = $db->getRelation($toid, $fromid);
         if ($relation == -1) {
             $relationOp = $db->getRelation($fromid, $toid);
             if ($relationOp == -1) {
                 $user = $db->updateRequest($fromid, $toid);
                 if ($user != false) {
                     // user found
                     // echo json with success = 1
                     $response["success"] = 1;
                     $response["success_msg"] = "Friend Request Sent";
                     echo json_encode($response);
                 } else {
                     // user not found
                     // echo json with error = 1
开发者ID:h4r5h4,项目名称:GeoRemindMe,代码行数:31,代码来源:index.php

示例2: echo

<?php

require_once 'include/DB_Functions.php';
$db = new DB_Functions();
$email = "harsha@gmail.com";
$emailId = $email;
$toId = $db->getUid($emailId);
$idArr = $db->getReminders($toId);
if ($idArr == -1) {
    $resp["reminders"] = "no reminders";
    echo json_encode($resp);
} else {
    $resp["id"] = $idArr;
    $resp["emails"] = $idArr;
    echo json_encode($resp);
}
/* $toEmail = "harsha.ms7@gmail.com";
      echo $db->deleteReminder(2);
      // echo $arr[0][0];
        /*
       
       echo ($db->getReminders(1));
        /*
       
       $fromid = $db->getUid($email);
       echo $fromid;
       $toid = $db->getUid($toEmail);
       echo "toid" . $toid;
       echo  $db->setReminder("Pick Me up", $fromid, $toid, 70.6588, -85.2365, "Charlotte", 50 );       /*
       if( $db->getRelation($fromid, $toid)==-1)
       {
开发者ID:h4r5h4,项目名称:GeoRemindMe,代码行数:31,代码来源:testdb.php


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