$username Posted November 25, 2007 Share Posted November 25, 2007 Hello People, I need to do a select on a field from a table in MYSQL and then make that select equal a variable. I am not able to do so with my code. can someone tell me what I am doing wrong Here is my code <?PHP include 'dbopen.php'; include 'dbconnect.php'; $username = ($_COOKIE["user"]); $RandomGen = ($_COOKIE["RandomGen"]); echo "<br>Random Value = ".rand(1000000000,9999999999); print_r($_COOKIE); //SELECT RandomGen FROM `admin` WHERE username = \ 'test\' $sql102 = mysql_query("SELECT RandomGen FROM admin WHERE username = '$username'"); $row102 = mysql_fetch_array($sql102) or die ("no data"); $RandomGenDB = $row102; echo $RandomGenDB, $username, $RandomGen ; ?> Quote Link to comment Share on other sites More sharing options...
trq Posted November 25, 2007 Share Posted November 25, 2007 You might try.... $RandomGenDB = $row102['RandomGen']; otherwise, you might try explaining yourself clearer. Quote Link to comment Share on other sites More sharing options...
$username Posted November 25, 2007 Author Share Posted November 25, 2007 Thank you that is what I needed. 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.