Widget not showin data from db
-
Hi,
I’m a newbie with word press and widget and plugins and I’m trying to develop a widget to issue open badges. I’m having problems with the display of data in the database. In the admin area of a widget I’m trying to do a drop down menu for selecting a value from a database and the values are not shown.
I have a separate file names settings.php which I included in the widget with include_once (‘settings.php’); at the top of the widget. In the settings file I have some data for the badges and issuer and I access the wpdb. Then in the widget I fill the drop down menu with the values from the database like so:for($i=0; $i < count($badges_array); $i++) { if($languages_array[$i["name"]==$_SESSION['country']) { echo '<option id="'.$languages_array[$i]["code"].'"selected>'.$languages_array[$i]["name"].'</option>'; } else { echo '<option id="'.$languages_array[$i]["code"].'">'.$languages_array[$i]["name"].'</option>'; } }
And when in the admin panel of the widget I try to select the value it’s just empty. It shows the correct length of a drop down, but there’s nothing in there, it’s blank, empty. Please help. What am I doing wrong?
Thank you for any reply.
- The topic ‘Widget not showin data from db’ is closed to new replies.