$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 ; ?> Link to comment https://forums.phpfreaks.com/topic/78840-solved-outputting-mysql-query/ 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. Link to comment https://forums.phpfreaks.com/topic/78840-solved-outputting-mysql-query/#findComment-399003 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. Link to comment https://forums.phpfreaks.com/topic/78840-solved-outputting-mysql-query/#findComment-399005 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.