oldspicelong Posted July 31, 2009 Share Posted July 31, 2009 im not sure why this script isnt updating the two variables to Akatsuki any idea whats wrong? <?php $sql = mysql_query("SELECT * FROM users WHERE username = '$username'"); $row = mysql_fetch_array($sql); if($row['rank'] = 'Jonin'){ mysql_query("UPDATE `users` SET `rank` = 'Akatsuki', `village` = 'Akatsuki' WHERE username = '$username'") or die(mysql_error()); echo '<center>You have become a member of the Akatsuki.</center>'; }else{ echo '<center>You have failed to become a member of the Akatsuki!</center>'; } ?> Link to comment https://forums.phpfreaks.com/topic/168249-quck-script-help/ Share on other sites More sharing options...
phpSensei Posted July 31, 2009 Share Posted July 31, 2009 1. Where is the USERNAME coming from? 2. Print out the RANK and see if its JOnin. Link to comment https://forums.phpfreaks.com/topic/168249-quck-script-help/#findComment-887428 Share on other sites More sharing options...
oldspicelong Posted July 31, 2009 Author Share Posted July 31, 2009 the username is stored as a cookie or something like that i forget and i know for a fact the rank is equal to Jonin Link to comment https://forums.phpfreaks.com/topic/168249-quck-script-help/#findComment-887430 Share on other sites More sharing options...
phpSensei Posted July 31, 2009 Share Posted July 31, 2009 if($row['rank'] = 'Jonin'){ to if($row['rank'] == 'Jonin'){ also print the $row['rank'] just to be sure. Link to comment https://forums.phpfreaks.com/topic/168249-quck-script-help/#findComment-887432 Share on other sites More sharing options...
oldspicelong Posted July 31, 2009 Author Share Posted July 31, 2009 i made that last change and it said you have failed to become an Akatsuki Link to comment https://forums.phpfreaks.com/topic/168249-quck-script-help/#findComment-887433 Share on other sites More sharing options...
phpSensei Posted July 31, 2009 Share Posted July 31, 2009 i made that last change and it said you have failed to become an Akatsuki print the RANK! see what it outputs $sql = mysql_query("SELECT * FROM users WHERE username = '$username'"); $row = mysql_fetch_array($sql); print $row['rank']; if($row['rank'] == 'Jonin'){ mysql_query("UPDATE `users` SET `rank` = 'Akatsuki', `village` = 'Akatsuki' WHERE username = '$username'") or die(mysql_error()); echo '<center>You have become a member of the Akatsuki.</center>'; }else{ echo '<center>You have failed to become a member of the Akatsuki!</center>'; } Link to comment https://forums.phpfreaks.com/topic/168249-quck-script-help/#findComment-887434 Share on other sites More sharing options...
oldspicelong Posted July 31, 2009 Author Share Posted July 31, 2009 it came out blank Link to comment https://forums.phpfreaks.com/topic/168249-quck-script-help/#findComment-887439 Share on other sites More sharing options...
phpSensei Posted July 31, 2009 Share Posted July 31, 2009 it came out blank theres the problem check the database. and print the USERNAME also Link to comment https://forums.phpfreaks.com/topic/168249-quck-script-help/#findComment-887444 Share on other sites More sharing options...
oldspicelong Posted July 31, 2009 Author Share Posted July 31, 2009 they are both coming up blank Link to comment https://forums.phpfreaks.com/topic/168249-quck-script-help/#findComment-887446 Share on other sites More sharing options...
phpSensei Posted July 31, 2009 Share Posted July 31, 2009 they are both coming up blank where are you setting the COOKIE? post the user login script i guess Link to comment https://forums.phpfreaks.com/topic/168249-quck-script-help/#findComment-887447 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.