brsy nah mang May 12, 2011 1,530 272 Dec 8, 2011 #1 Would this work as a session? PHP: <?php $result = $mysqli->fetch_array(query("SELECT * FROM users")); $_SESSION['zId'] = $result['zId']; $_SESSION['zUsername'] = $result['zUsername']; $_SESSION['zEmail'] = $result['zEmail']; ?>
Would this work as a session? PHP: <?php $result = $mysqli->fetch_array(query("SELECT * FROM users")); $_SESSION['zId'] = $result['zId']; $_SESSION['zUsername'] = $result['zUsername']; $_SESSION['zEmail'] = $result['zEmail']; ?>
Markshall Русский Стандарт Contributor Dec 18, 2010 2,637 2,389 Dec 8, 2011 #2 I'm not familiar with MySQLi so I'm not sure whether the $mysqli would work, but make sure you have session_start();, so it becomes: PHP: <?php session_start(); $result = $mysqli->fetch_array(query("SELECT * FROM users")); $_SESSION['zId'] = $result['zId']; $_SESSION['zUsername'] = $result['zUsername']; $_SESSION['zEmail'] = $result['zEmail']; ?> Upvote 0 Downvote
I'm not familiar with MySQLi so I'm not sure whether the $mysqli would work, but make sure you have session_start();, so it becomes: PHP: <?php session_start(); $result = $mysqli->fetch_array(query("SELECT * FROM users")); $_SESSION['zId'] = $result['zId']; $_SESSION['zUsername'] = $result['zUsername']; $_SESSION['zEmail'] = $result['zEmail']; ?>
Kryptos prjRev.com Jul 21, 2010 2,205 1,252 Dec 8, 2011 #3 Why don't you try to test the code, and then ask for help if the code fails and you don't know how to do it... Upvote 0 Downvote
Why don't you try to test the code, and then ask for help if the code fails and you don't know how to do it...
brsy nah mang May 12, 2011 1,530 272 Dec 8, 2011 Thread starter #4 Christ said: Why don't you try to test the code, and then ask for help if the code fails and you don't know how to do it... Click to expand... Good advice; I will test it right after I code my login system... Upvote 0 Downvote
Christ said: Why don't you try to test the code, and then ask for help if the code fails and you don't know how to do it... Click to expand... Good advice; I will test it right after I code my login system...