PHP MySQL Drop Down Box Populate Selected Value

后端 未结 1 1473
被撕碎了的回忆
被撕碎了的回忆 2020-12-20 09:19

I have read tutorials about how to populate an entire Drop down list with MySQL, but the problem I am running into is that I only want to grab the one from the database and

1条回答
  •  北荒
    北荒 (楼主)
    2020-12-20 09:32

    In your element add the selected attribute for the value that is in itemschoice.

    Crude example using a made up function to get the choice:

    $choice = get_items_choice();
    $results = mysqli_query($sql);
    
    echo '';
    

    This is just an example, don't copy & paste this without adding some kind of error verification!

    0 讨论(0)
提交回复
热议问题