mybluehair Posted November 21, 2007 Share Posted November 21, 2007 ok, i have a membership system. one of the feilds in the 'users' table in mysql is called rank. it has 2 posibilities. 1 or 2. 1 means ur a regular member. 2 means your an admin. so in the admin panel, i want to make a part were you can change the rank on a certain user. i was thinking about maybe a html form kinda, where you enter there username, then php searches for it in mysql. when it finds the desired row, it will display there ranking in a dropdown menu. you can change the ranking in this drop-down, and then click submit. then php would change the ranking in mysql. can someone show me the basic sql commands and php to do this? Quote Link to comment https://forums.phpfreaks.com/topic/78180-phpmysql-changing-a-mysql-table-name-threw-php/ Share on other sites More sharing options...
wsantos Posted November 21, 2007 Share Posted November 21, 2007 The concept would be like this...Just fill in the blanks $username = $_POST['username']; $newRank = $_POST['rank']; $result=mysql_query("SELECT uid FROM tblUsers WHERE username = '$username'); $record = mysql_fetch_row($result); $update="UPDATE tblUsers SET rank='$newRank' WHERE username='$username' "; $update_result=mysql_query($update); Quote Link to comment https://forums.phpfreaks.com/topic/78180-phpmysql-changing-a-mysql-table-name-threw-php/#findComment-395638 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.