html - Radio button is not checked dynamically in php

Solution:

Try out just checked

<input type="radio" id="drone" name="drone" value="drone" checked>

Answer

Solution:

Else clause in echo is redundant. Checkout this code:

<Input type="radio" name="vyber_tb" class="prepinac cursorPointer" value="<?php echo $db_hod;?>" <?php if($nazov_db == $db_hod) echo 'checked';?>>

Always follow standards. Use either single or double quotes(I recommend double quotes for HTML and single quotes for PHP) for HTML and PHP, and follow it throughout your code. Look how much readable is the above code compared to your code.

In standard HTML checked is a standalone attribute which could be used with <input type="checkbox"> and <input type="radio">. Though browsers support all these variations of checked:

checked
checked = "true"
checked = "checked"

only the first one is recommended by W3C. Source: W3C

Also the autocomplete attribute works with the following types: text, search, url, tel, email, password, datepickers, range, and color. Source: W3C

Also whenever possible use single quotes (') with php. Using 'Single quoted' strings is more efficient as the contents of the string displayed "as is". Variables and escape sequences except \\ will not be interpreted. Which makes them lot more efficient than "Double quoted" strings.

Source