- 0
[PHP][MySQL] compare session info to db in a query
-
Recently Browsing 0 members
- No registered users viewing this page.
-
Posts
-
By Davin Peterson · Posted
Yes, Google Lens -
By hellowalkman · Posted
Microsoft improves Windows 11 Search UI settings, confirms group policy bug in build 27919 by Sayan Sen Microsoft has released a new Windows 11 build for Insiders flighting the Canary channel. The new build, 27919, brings a new refreshed UI/UX for the Search page in the Settings app. Alongside that, the company also fixes multiple bugs including one wherein File Explorer would crash if a user accessed the digital signature information via the right-click context menu. The build also has plenty of known issues too including one where multiple errors would pop up when working with the Group Policy editor, as well as a multi-monitor issue in remote desktop applications. The full changelog is given below: [Windows Search] Today, we rationalize and organize Windows Search settings under Settings > Privacy & security under a “Search permissions” settings page and a “Searching Windows” settings page. We are beginning to roll out a change that brings those two settings pages together so you can easily access to all the Windows Search settings under a single settings page via Settings > Privacy & security > Search. The page is refreshed with a new modern visual for you to clearly browse the settings and control your experiences inside Windows Search, with the items listed in a better order. The updated single settings page for Windows Search. The bug fixes are as follows: [File Explorer] Fixed an issue where File Explorer might crash when trying to view the digital signatures tab in the properties for a file. [Input] Fixed an issue which was causing the Microsoft Changjie Input method to not work properly in the previous build. Fixed an issue which was causing phonetic keyboards, such as the Hindi Phonetic Input keyboard and the Marathi Phonetic keyboard, to not work properly in the previous build. Finally, the known issues are: [General] [IMPORTANT NOTE FOR COPILOT+ PCs] If you are joining the Canary Channel on a new Copilot+ PC from the Dev Channel, Release Preview Channel or retail, you will lose Windows Hello pin and biometrics to sign into your PC with error 0xd0000225 and error message “Something went wrong, and your PIN isn’t available”. You should be able to re-create your PIN by clicking “Set up my PIN”. The progress wheel may show as a rectangle glyph instead of rendering correctly when upgrading to this build. [NEW] You may see multiple error pop ups about unexpected elements when opening Group Policy Editor. [NEW] There’s an underlying issue with dao360.dll in this build which may result in some apps crashing. [Remote desktop] [NEW] There’s an issue starting with the last build where remote desktop only uses your primary monitor even if it’s configured to use multiple monitors. You can find the official blog post here on Microsoft's website. -
-
By Nas · Posted
Subscribers who pay for Higher Tier pricing (and wealthy power-hungry wh0res in general) don't GAF about the value or having a conscience for their actions/decisions/impacts. They want POWER and authority to do WTF they wanna do, no matter how petty, ludicrous, wasteful, damaging, or useless. Sadly, there are many power-hungry folks out there than truly admit it! They truly believe that their banal requests for Wikipedia regurgitate is truly an academically deep thought experiment warranting any of their oft-untapped Thinking Model usage tokens. As the saying goes, Ya Can't Change Stupid (no matter how wealthy they are or appear to be). -
-
-
Recent Achievements
-
Jaclidio hoy earned a badge
One Month Later
-
Yawdee earned a badge
Week One Done
-
eugwalker earned a badge
Week One Done
-
Ben Gross earned a badge
First Post
-
chiptuning earned a badge
One Month Later
-
-
Popular Contributors
-
Tell a friend
Question
saiya
Hi,
I got a log-in script going and I have it so it sets up a new session() when it logs the user in.
i have on my index.php a session_start() that stores $_SESSION['user_id'] = $row['user_id']; and $_SESSION['username'] = $row['username'].
then in my account.php I thought of doing the samething and add to my session more information so I did another db query and tried to created my $_SESSION variables to store the extra info I wanted to pull out.
My syntax is correct, and my SQL query is correct aswell.
include 'dbc.php'; page_protect(); session_start(); $row = mysql_fetch_assoc(mysql_query("SELECT company_name FROM agent_company WHERE agent_id = '{$_SESSION['user_id']}'")); if($row['company_name']) { $_SESSION['company_name'] = $row['company_name']; exit; }
as you can see I'm trying to pull the data by comparing that it will only pull that data that belongs to the user of the current session. I used my $_SESSION['user_id'] that was created in my index.php here.
Can I not pull session data on a new page with an existing session? or do I need to add ALL the information I want to use all in one swoop? then just access it later on when I need it...?
in my page_protect() function I have this
function page_protect() { session_start(); //check for cookies if(isset($_COOKIE['user_id']) && isset($_COOKIE['username'])){ $_SESSION['user_id'] = $_COOKIE['user_id']; $_SESSION['username'] = $_COOKIE['username']; } if (!isset($_SESSION['user_id'])) { header("Location: account.php"); }
Link to comment
https://www.neowin.net/forum/topic/897196-phpmysql-compare-session-info-to-db-in-a-query/Share on other sites
36 answers to this question
Recommended Posts