I am querying a mysql database and returning some user info including their access level. As the user level either 1 or 2 comes back from the database how do I have their user level selected using jQuery.
<select id="dropdown">
<option value="1">Admin</option>
<option value="2">General</option>
</select>
I want to set accesslevel to be what ever access level the user has:
$(document).ready(function(){
$("#dropdown").val('accesslevel');
});
Sorry but I am an absolute beginner. I tried to get access level from php variable name using this but its not working.
<?php $accesslevel; ?>