本文整理汇总了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;
}
}