Trying to add a widget into wordpress with data
-
I am trying to add a widget with a drop down and in a wordress widget but the following code is not working when I look at the source its putting a comment tag around the code some reason.
<label for=”<?php echo $this->get_field_id(‘dropdown’); ?>”><?php _e(‘Liters’, ‘wp_widget_plugin’); ?></label>
<select>
<? $sql = “SELECT ‘liters’ FROM ” . $wpdb->prefix . “tfp”;$liters = $wpdb->get_col( $sql );
if( $liters ) {
foreach( $liters as $liter ) {
echo ‘<option value=”‘ . $liter . ‘”>’ . $liter . ‘</option>’;
}
}
?></select>
It is jsut displaying the word liter in the drop down and not pulling data
- The topic ‘Trying to add a widget into wordpress with data’ is closed to new replies.