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" Link to comment https://forums.phpfreaks.com/topic/217145-cookie-db-issue/ 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. Link to comment https://forums.phpfreaks.com/topic/217145-cookie-db-issue/#findComment-1127766 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.