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/>"; ?> 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 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 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? 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 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
Archived
This topic is now archived and is closed to further replies.