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