mysql - sql/php query to set the value of a variable -
i have table called "users" has columns 'username', 'password' , 'permission'. in permission column either 'browse' or 'edit'. have user logged site, want select select permission using username (which have stored in session variable). want set variable equal either 'browse' or 'edit' based on permission, use in further logic. assuming have connected , selected appropriate database pretty sure php code , query should go like: $u = $_session['username'] ; $sql = "select permission users username = '$u' " ; $result = mysqli_query($sql); but im unsure how set variable equal 'browse' or 'edit' accordingly. any ideas? say have connection $con , using session have start session. $u = $_session['username'] ; $sql = "select `permission` `users` username='$u'"; $result = mysqli_query($con, $sql); $rows = mysqli_fetch_object($result); /...