I have a table called user_badges and a field called badge1 with the default value written "locked" when a user unlocks the badge the field is updated to "unlocked"
What I want is the script to check the value in the field badge 1 in the table WHERE $username = $_SESSION['username']; and display the image of the badge located in a folder on my site.
I have an idea on how to go about it but not sure how to fully execute this.
//Connect to database
<?php
$connect = mysql_connect("host","username","password");
mysql_select_db("database_name");
?>
if field (field_name) from table (table_name) value= unlocked
echo/display image from (images/badges/fanaticbadge.png)
else echo/display (images/badges/locked.png)
Is this possible? Thanks for any assistance !