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


PHP db::returnrow方法代码示例

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


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

示例1: runIPcheck

 public function runIPcheck()
 {
     $myIP = $this->getIP();
     $localIP = str_replace('.', '', $this->addZeros($myIP));
     $sql = "SELECT * FROM firewall_rules WHERE '{$localIP}' >= from_ip AND '{$localIP}' <= to_ip ";
     $result = db::returnrow($sql);
     if ($result) {
         if ($result['mode'] == 1) {
             return true;
         } else {
             return false;
         }
     } else {
         return false;
     }
 }
开发者ID:TohuMuna,项目名称:akonga,代码行数:16,代码来源:firewall.php

示例2: getQuizTitle

 public function getQuizTitle($quizid)
 {
     $sql = "SELECT quiz_title FROM quiz WHERE quizid='" . db::escapechars($quizid) . "'";
     $result = db::returnrow($sql);
     return $result['quiz_title'];
 }
开发者ID:TohuMuna,项目名称:akonga,代码行数:6,代码来源:quiz.php

示例3: convertUUIDtoRegisterID

 public function convertUUIDtoRegisterID($id)
 {
     $sql = "SELECT registerid FROM registers WHERE uuid='" . db::escapechars($id) . "'";
     $result = db::returnrow($sql);
     return $result['registerid'];
 }
开发者ID:TohuMuna,项目名称:akonga,代码行数:6,代码来源:register.php

示例4: getUserInfo

 public function getUserInfo($userid)
 {
     $sql = "SELECT\n                       *\n                   FROM\n                       users\n                   WHERE\n                       userid='" . db::escapechars($userid) . "'\n                   ";
     $result = db::returnrow($sql);
     return $result;
 }
开发者ID:gingercoder,项目名称:vogel,代码行数:6,代码来源:microframework.php

示例5: maintainauth

 public function maintainauth()
 {
     // Maintain Authentication using session variables and a connection to the DB
     if ($_SESSION['username'] == "" || $_SESSION['passwd'] == "" || $_SESSION['utype'] == "") {
         if ($_POST['username'] !== "" && $_POST['passwd'] !== "" && $_POST['z'] == "login") {
             // Authenticating against scripts so allow through this check script
             return 'authing';
         } else {
             // Log in form required
             return 'noauth';
         }
     } else {
         /*
          *
          * Should be authenticated ok but always check the authentication
          * in case SESSION vars are being tampered with
          *
          */
         $username = db::escapechars($_SESSION['username']);
         $sql = "SELECT * FROM users WHERE username = '" . $username . "'";
         $result = db::returnrow($sql);
         if ($result) {
             // If there is a match set the session variables
             if ($_SESSION['passwd'] == $result['password']) {
                 $_SESSION['username'] = $username;
                 $_SESSION['passwd'] = $_SESSION['passwd'];
                 $_SESSION['utype'] = $result['user_type'];
                 return 'auth';
             } else {
                 // Stored data doesn't match that passed to it - log the activity and destroy data
                 // Log the spurious activity
                 $logType = "Session Auth";
                 $IPAddress = $_SERVER["REMOTE_ADDR"];
                 $logValue = db::escapechars($_SESSION['username']) . " Tried Session maintain - Failed auth maintain from {$IPAddress}";
                 $this->logevent($logType, $logValue);
                 // Kill the session variables and give an error message
                 $_SESSION['username'] = "";
                 $_SESSION['passwd'] = "";
                 $_SESSION['utype'] = "";
                 // return failure
                 return "fail";
                 session_destroy();
                 return 'noauth';
             }
         } else {
             // Couldn't get the username - need to authenticate again because something is wrong
             return 'noauth';
         }
     }
 }
开发者ID:gingercoder,项目名称:vogel,代码行数:50,代码来源:authentication.php

示例6: getDiaryEvent

 public function getDiaryEvent($eventid)
 {
     $sql = "SELECT * FROM class_diary WHERE event_id='" . db::escapechars($eventid) . "'";
     $result = db::returnrow($sql);
     return $result;
 }
开发者ID:TohuMuna,项目名称:akonga,代码行数:6,代码来源:classes.php

示例7: getGravatarIcon

 public function getGravatarIcon($userid, $iconsize = '30')
 {
     // Gravatar requires an MD5 of the email address to poll for an image so grab from DB and output URL
     $sql = "SELECT\n                    email_address\n                FROM\n                    users\n                WHERE\n                    userid='" . db::escapechars($userid) . "'";
     $result = db::returnrow($sql);
     $email = $result['email_address'];
     return "//www.gravatar.com/avatar/" . md5($email) . "?s=" . db::escapechars($iconsize);
 }
开发者ID:TohuMuna,项目名称:akonga,代码行数:8,代码来源:akonga.php

示例8: uuidtoruleid

 public function uuidtoruleid($uuid)
 {
     $sql = "SELECT rule_id FROM firewall_rules WHERE uuid='" . db::escapechars($uuid) . "'";
     $result = db::returnrow($sql);
     return $result['rule_id'];
 }
开发者ID:gingercoder,项目名称:vogel,代码行数:6,代码来源:firewall.php

示例9: getSingleTweet

 public function getSingleTweet($twitterid = '', $stackid = '')
 {
     if ($twitterid != "") {
         $sql = "SELECT * FROM tweetstack WHERE twitterID='" . db::escapechars($twitterid) . "'";
     } elseif ($stackid != "") {
         $sql = "SELECT * FROM tweetstack WHERE twitterID='" . db::escapechars($twitterid) . "'";
     } else {
         $sql = "SELECT * FROM tweetstack WHERE flaggedAbuse !='1' ORDER BY dateCreated DESC";
     }
     $result = db::returnrow($sql);
     return $result;
 }
开发者ID:gingercoder,项目名称:vogel,代码行数:12,代码来源:vogel.php

示例10: viewContent

 public function viewContent($uuid)
 {
     $sql = "SELECT * FROM class_documents WHERE document_id='" . $this->convertUUIDToContentID(db::escapechars($uuid)) . "'";
     $result = db::returnrow($sql);
     return $result;
 }
开发者ID:TohuMuna,项目名称:akonga,代码行数:6,代码来源:content.php

示例11: uuidToMessageID

 public function uuidToMessageID($uuid)
 {
     $sql = "SELECT message_id FROM user_messages WHERE uuid='" . db::escapechars($uuid) . "'";
     $result = db::returnrow($sql);
     return $result['message_id'];
 }
开发者ID:TohuMuna,项目名称:akonga,代码行数:6,代码来源:messages.php


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