desjardins2010 Posted December 22, 2010 Share Posted December 22, 2010 I'm getting error unknowing colum 'solidsoul' in Where clause why is it refering $player = solidsoul to a colum instead of searching the colum username for solidsoul? <?php //start progress bar check to see if the systemkey on server is greater than the passwordcracker or equal if it is let it go if not stop it $db = mysql_connect ("localhost","removed","removed") or die ("Could Not Connect To Database"); $select = mysql_select_db ('heaven_users') or die ("Could Not Select Database"); $query = mysql_query ("SELECT systemkey FROM members WHERE IPaddress=$ip") or die (mysql_error()); $query2 = mysql_query ("SELECT * FROM members WHERE username=$player") or die (mysql_error()); while ( ($row1 = mysql_fetch_assoc($query)) && ($row2 = mysql_fetch_assoc($query2)) ) { $systemkey = $row['systemkey']; $passwordcracker = $row2['passwordcracker']; } echo $systemkey; echo $passwordcracker; ?> Quote Link to comment Share on other sites More sharing options...
trq Posted December 22, 2010 Share Posted December 22, 2010 Strings need to be surrounded in quotes in most (all) programming languages including SQL. Quote Link to comment Share on other sites More sharing options...
desjardins2010 Posted December 22, 2010 Author Share Posted December 22, 2010 I don't see where I'm missing "" Quote Link to comment Share on other sites More sharing options...
trq Posted December 22, 2010 Share Posted December 22, 2010 $query = mysql_query ("SELECT systemkey FROM members WHERE IPaddress='$ip'") or die (mysql_error()); $query2 = mysql_query ("SELECT * FROM members WHERE username='$player'") or die (mysql_error()); Quote Link to comment Share on other sites More sharing options...
trq Posted December 22, 2010 Share Posted December 22, 2010 You should also be getting that done in one query not two. Quote Link to comment Share on other sites More sharing options...
desjardins2010 Posted December 22, 2010 Author Share Posted December 22, 2010 lol how you do one query I thought I was doing well with the one while statment Quote Link to comment Share on other sites More sharing options...
Rifts Posted December 22, 2010 Share Posted December 22, 2010 $onequery= mysql_query ("SELECT * FROM members WHERE IPaddress='$ip' AND username='$player' ") or die (mysql_error()); 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.