List all categories in options

To get a list of selectable categories use wp_dropdown_categories().
Example:

wp_dropdown_categories(
    array (
        'orderby' => 'name',
        // ID of the already selected category:
        'selected' => 4,
        // If no category is selected:
        'show_option_none' => 'Choose one'
    )
);

HTML output:

<select name="cat" id='cat' class="postform" >
    <option value="-1">Choose one</option>
    <option class="level-0" value="4" selected="selected">Animals</option>
    <option class="level-0" value="6">Hyperbolica</option>
    <option class="level-0" value="5">Nonsense</option>
    <option class="level-0" value="1">Uncategorized</option>
</select>

Visual output:

enter image description here

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)