unemployment Posted October 28, 2010 Share Posted October 28, 2010 How can I use a cookie to pull data from my db. Right now I have it set up to pull data from a session variable, but I need it to be able to display data from both since I am implementing a remember me checkbox on my login. Current Code: $q = mysql_query("SELECT `firstname`, `lastname`, `firstname`, `lastname`, `email`, `entrepreneur`, `investor`, `companyname`, `companywebsite`, `founder`, `phone`, `address`, `city`, `state`, `zipcode`, `country`, `development`, `capitalamount`, `companydo`, `founderbuilt`, `understand`, `competition`, `money`, `demo`, `incorporation`, `companynameinv`, `phoneinv`, `addressinv`, `cityinv`, `stateinv`, `zipcodeinv`, `countryinv`, `angel`, `vc`, `capital` FROM `users` WHERE username= '" . $_SESSION['username'] . "'"); $r = mysql_fetch_assoc($q); if (!isset ($_GET['u'])&&($_SESSION['username'])||($_COOKIE['username'])) { echo "blahblah" Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted October 28, 2010 Share Posted October 28, 2010 when the user returns with the "remember me" cookie and you start a new session, you should have the session data that you need. no need to store the data in a separate cookie. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.