Jump to content

Artsybetty

Members
  • Posts

    5
  • Joined

  • Last visited

Artsybetty's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. whats the best way to set session variables from db? i'm kinda new to this, so im just checking the session variable "uid" against the users id in the db, and if true, posting something, should i be doing this totally different? any help is apreciated $result = mysql_query("SELECT * FROM `users` WHERE `id`='".$_SESSION["uid"]."' LIMIT 1"); while($row = mysql_fetch_array($result)) { echo $row['username']; echo $row['id']; }
  2. excuse my VERY short hand in the previous post, ^^ thats exactly what i was looking for. thankyou both for the input!
  3. so, as my uid contains no letters, if isset( (int) $_SESSION['uid'] === 0 ){ not logged content} else {logged in content} should work? and i'm presuming that (based on your post) checking for non logged users first is the best route?
  4. this will be used to check for a valid user id to show certain pages to logged in users, does it make a difference (beside the obvious order after the statements) and if so what method is more secure? any suggestions are appreciated
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.