title: (PHP SQL) using SQL data across PHP-powered site
body: <p>Coming directly from iOS development in Swift I recently started to work with PHP. I'm making a small PHP powered website with a simple userlogin and some features for registered users.</p>
  
  <p>However, I have a general question regarding the data I pull from the SQL database. </p>
  
  <p>In Swift, I took the data and stored it in variables that I could use through the entire app.</p>
  
  <p>What is the "correct" way of doing so in PHP? As of now, I connect to the SQL database when the user log into the site. I then connect again to retrieve some user data. And then again on another section of the site where I need to update the SQL database for the specific user. </p>
  
  <p>It seems like a hell of a lot of SQL requests (UPDATE, INSERT, SELECT) if the site had say 500 users? </p>
  
  <p>So I thought - there must be an easier way. </p>
  
  <p>Can someone point me in the right direction?</p>
  
  <p>Thanks in advance. </p>