Get dropdown items from mysql database




In this tutorial I will show you how to connect to your MySQL server and retrieve information to insert into your dropdown menu. You will also learn a couple of …

source


35 responses to “Get dropdown items from mysql database”

  1. Hi.. thank you for the amazing tutorial. I am a beginner to PHP SQL and I have a question at 5.31 sec close function. If the entire code is inline, then the close function closes the database as soon as the database is connected.. I am confused how the SELECT query processes if the connection is closed. Kindly clarify.

  2. Two points – 1.)  MYSQL_CONNECT is depricated meaning it won't be around much longer.  You should teach more current methods.  2.) That bird is annoying as shit.  Put a blanket over its cage before you make a video.  

  3. Hi, thanks for such an interesting tutorial.
    I would like to know, who can I select a value from the database in an <select> and also grab the another value from the same row in an Text box.
    Example: I want to be able to select a name from a Combobox from my DB, and to have the email in and textbox.

    Could you help me out?

  4. Im sorry but this is just horrible. It makes no sense to create all those functions especially when you are creating a tutorial for beginners. Also why would you make a whole php connection file and not actually CONNECT to the data base!

    Finally your recording volume is at like 0.1 and you have some bird/animal chirping away through the entire video!

  5. nice tutorial, however, instead of;
        echo '<option value = "' . $record['item'] . '">' . $record['item'] . ' "</option>";

    my application needed
        echo '<option value = "' . $record['id'] . '">' . $record['item'] . ' "</option>";

    I don't store values for foreign keys, I store their record Ids.  That way, if a value changes I don't have to go to all my tables that store that value and change them since the Id remains the same.

    Except of course for BI tables, in which case the value is appropriate due to the historic nature of BI.

    Great vid!!!

Leave a Reply