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


PHP Self::getUserId方法代码示例

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


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

示例1: getUserInfo

 public function getUserInfo()
 {
     # Get the user id
     $userId = Self::getUserId();
     # the prepared statement
     if ($sStmt = $this->mysqli->prepare("SELECT users.id, users_social.facebook, users_social.twitter, users_social.linkedin, \n                                                  users_social.website, users_social.instagram, users_info.firstname, users_info.lastname, \n                                                    users_info.lang, files.new_name, files_extensions.extension, users_info.job_title, users_info.mobile, \n                                                      users_info.about, users.username, users_info.page_slug\n                                          FROM users_info\n                                          LEFT JOIN users on users_info.users_id = users.id\n                                          LEFT JOIN users_social on users_social.users_id = users.id\n                                          LEFT JOIN files on users_info.img = files.id\n                                          LEFT JOIN files_extensions on files.extension = files_extensions.id\n                                          WHERE users.id = ?")) {
         # bind
         $sStmt->bind_param("i", $userId);
         #execute
         $sStmt->execute();
         # bind result
         $sStmt->bind_result($id, $facebook, $twitter, $linkedin, $website, $instagram, $firstname, $lastname, $lang, $new_name, $extension, $job_title, $mobile, $about, $username, $page_slug);
         //fetch it
         if ($sStmt->fetch()) {
             $result = array('id' => $id, 'facebook' => $facebook, 'twitter' => $twitter, 'linkedin' => $linkedin, 'website' => $website, 'instagram' => $instagram, 'firstname' => $firstname, 'lastname' => $lastname, 'lang' => $lang, 'new_name' => $new_name, 'extension' => $extension, 'job_title' => $job_title, 'mobile' => $mobile, 'about' => $about, 'username' => $username, 'page_slug' => $page_slug);
         }
         // echo "<pre>";
         // var_dump($result);
         // exit;
         return $result;
     }
 }
开发者ID:RhenusoneRosalia,项目名称:portfolio,代码行数:22,代码来源:User.php


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