oldspicelong Posted August 6, 2009 Share Posted August 6, 2009 below is the code including the html and i cant figure out what is wrong with the php script <?php mysql_connect("mysql", "notforyou", "notforyou") or die(mysql_error()); mysql_select_db("notforyou") or die(mysql_error()); $username = $_COOKIE['ID_my_site']; $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' WHERE username = '$username'") or die(mysql_error()); echo '<center>You have become a member of the Akatsuki . '.$username.'</center>'; }else{ echo '<center>Your not qualified enough for this job.</center>'; } echo "Name:".$row['username']."<br/>"; echo "Level:".$row['level']."<br/>"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/169038-solved-cant-figure-it-out/ Share on other sites More sharing options...
wildteen88 Posted August 6, 2009 Share Posted August 6, 2009 below is the code including the html and i cant figure out what is wrong with the php script If you dont know, how are we supposed to know. Can you explain what you're trying to do, tell use what the script is supposed to do, what it doing now and post any errors you get here in full Quote Link to comment https://forums.phpfreaks.com/topic/169038-solved-cant-figure-it-out/#findComment-891853 Share on other sites More sharing options...
oldspicelong Posted August 6, 2009 Author Share Posted August 6, 2009 its just supposed to update row 'rank' to be set to Akatsuki if rank is equal to Jonin Quote Link to comment https://forums.phpfreaks.com/topic/169038-solved-cant-figure-it-out/#findComment-891855 Share on other sites More sharing options...
Mardoxx Posted August 6, 2009 Share Posted August 6, 2009 $row['rank'] == Jonin $row['rank'] == "Jonin" maybe? Quote Link to comment https://forums.phpfreaks.com/topic/169038-solved-cant-figure-it-out/#findComment-891857 Share on other sites More sharing options...
oldspicelong Posted August 6, 2009 Author Share Posted August 6, 2009 it worked thanks Quote Link to comment https://forums.phpfreaks.com/topic/169038-solved-cant-figure-it-out/#findComment-892224 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.