Populating Drop Down menus from Database

Поделиться
HTML-код
  • Опубликовано: 13 дек 2024

Комментарии • 85

  • @louisjennings5203
    @louisjennings5203 4 года назад +7

    I've been researching this for two days solid and this is the first time I found a clear and concise explanation of what to do and why. Thank you immensely!

  • @chandresh.t6405
    @chandresh.t6405 3 года назад +1

    you are teaching very well sir thank you

  • @OsukaX
    @OsukaX 5 лет назад +9

    It worked, I was hitting my head against a wall before I've found this video. Thanks pal.

  • @senju31
    @senju31 3 года назад

    Much love from Jamaica. This is exactly what I was looking for and the video is very short. *Gracias*

  • @pavanvspk8928
    @pavanvspk8928 3 года назад

    bro... iam struggling with normal Mysql functions and wexed. But with this procedure...i am continuing with my work. Good Job from your side on posting this valuable video. TQ

  • @auroraseco5746
    @auroraseco5746 4 года назад

    a simple and practical example, thanks for the video

  • @kaivanDoshi
    @kaivanDoshi 4 года назад

    A small tip if using bootstrap then dont' forget to add class="custom-select mr-sm-2" id="inlineFormCustomSelect" in the select tag

  • @binoythomas2974
    @binoythomas2974 5 лет назад

    Simple but powerful. Thanks a lot.

  • @jacopieterse4674
    @jacopieterse4674 6 лет назад +2

    Nice, but how about in a relational db where you'd store the code of the Dept and not the name even though you'd like to display the name?

  • @johnvins2884
    @johnvins2884 5 лет назад

    A real novice here---I get the gist of it but not how to run it? What editor are you using and are you on windows or linux? Save the file where and then when you say go to localhost to see the dropdown list, doesn't the db and this file need to be in the same directory? I'm on Centos 6.5, have LAMP and phpmyadmin. A good start for me to learn how to start a subquery when I click on a name in the list and to show a hyperlink to it for more information about the selection.

  • @nitindhamale8789
    @nitindhamale8789 6 лет назад

    Nice one very good explanation

  • @dbean2321
    @dbean2321 5 лет назад

    Would love to see more videos on PHP PDO and advanced topics connecting Front and Backend

  • @dougbrown2035
    @dougbrown2035 5 лет назад +2

    great video! I'm very new to PHP, is there a good way to take the selection and populate another page with the choice? for example if the selection is "Administration", the user selects it, clicks a submit button and it takes them to another page populated by sql data related to that selection.

    • @phpBasics
      @phpBasics  5 лет назад +1

      Yep, that's very doable in a variety of ways. Hit me up on Skype if you want to discuss it further - CoolEditz

    • @dougbrown2035
      @dougbrown2035 5 лет назад

      @@phpBasics I appreciate it - I'll reach out sometime this week.

  • @iamsarb_0017
    @iamsarb_0017 3 года назад

    1 more question is - Is it compulsory to add data in column earlier so we can fetch& then again put it in another table
    is there any other way for this?

  • @snowfallztech
    @snowfallztech 4 года назад

    Based on your idea it helped me complete my university project issue but codes works on different work criteria .This Code doesn't helped but idea helped me though Thanks Buddy

  • @kingking-qj5bp
    @kingking-qj5bp 4 года назад

    very simple, the best simple one ever.

  • @ZetaHook
    @ZetaHook 4 года назад +1

    Good tutorial, but how do i get the array result to use it on another query? if I use this method the variable just select the last item show in the manu

    • @jgonsuron
      @jgonsuron 4 года назад

      I had the same problem. I solved it by creating multiple instances of the query - ie. $resultSet1, $resultSet2, $resultSet3, etc... it looks like once a query is run, the data generated can only be used in one while loop. I'm new and could be wrong, but this worked for me.

  • @azeeomole2083
    @azeeomole2083 3 года назад

    Hello thank you for the tutorial. How can I give the dropdown a scroll bar?

  • @oyekunleogunsina5266
    @oyekunleogunsina5266 5 лет назад

    Very concise. Thanks a lot

  • @silviopontes9832
    @silviopontes9832 3 года назад

    It was very good! If we have another information in table; How to fill in another field with according to the data on option selection?

  • @willemjacobusblom
    @willemjacobusblom 4 года назад

    You're the best! Thanks so much

  • @kumaratul484
    @kumaratul484 3 года назад

    Can we populated it in sign up form which will comes from plugin.
    If possible then please let me know.

  • @cybreed
    @cybreed 5 лет назад +1

    simple and nice, thank you!

  • @wamoka9381
    @wamoka9381 4 года назад

    👏 👏 Nice tutorial. I have a question 🙋. How do you make a dropdown select from a table in a database and insert the selected value into another table?

    • @phpBasics
      @phpBasics  4 года назад

      I have a tutorial on that coming up shortly! If you need some help, send me a message on Skype: CoolEditz

  • @aliyegulduk5166
    @aliyegulduk5166 4 года назад

    Thank you very much!

  • @Random-xs8dp
    @Random-xs8dp 3 года назад

    Big thank you bro

  • @MrMajorYT
    @MrMajorYT 6 лет назад

    Hi, I was wandering if you could help me. I have set the session and connected to MySQL Database fine, The problems come when i place the while loop around the existing IF statement for my session. It seems to be picking the records up individually rather than as a group. Any Suggestions?

    • @phpBasics
      @phpBasics  6 лет назад

      Send your source code to phpbasics@yahoo.com and I'll take a look at it.

  • @heartattackingirl
    @heartattackingirl 4 года назад

    thank u so much it was super easy and very helpful

  • @nikilasandarage1066
    @nikilasandarage1066 5 лет назад

    Thank you very much buddy!! This helped alot!! Explained precisely. Thanks again!

  • @abbasalibhai9815
    @abbasalibhai9815 4 года назад

    THANK YOU SO MUCH. You literally saved me! Thanks man!

  • @iTzBoosTerZx
    @iTzBoosTerZx 5 лет назад +2

    Great tutorial! But can you show how to do this with an external PHP file if this is possible in some way?

    • @senju31
      @senju31 3 года назад

      External php file?

  • @christiancolewan
    @christiancolewan 2 года назад

    Great tutorial, can you explain how we can set the value of each line/option so that each line will have the same value as the text once submitted, because I got blank data whenever I press on submit.

    • @phpBasics
      @phpBasics  2 года назад

      That's what I'm demonstrating in this video. If you're still having issues, you can hit me up on Skype: CoolEditz

    • @christiancolewan
      @christiancolewan 2 года назад +1

      @@phpBasics I appreciate your fast reply, I was able to pass the text into the option 'value'
      here's what I did.







      class="ass"id="xyz" onChange="window.location.href=this.value">
      Actions

  • @johnattipoe7440
    @johnattipoe7440 5 лет назад

    How do you add the selected value to a new table

  • @christiannibarger4996
    @christiannibarger4996 4 года назад

    You're a God. Thank you for this

  • @sofienmefteh993
    @sofienmefteh993 6 лет назад

    Thank you so much sir. You helped me . I was blocked for two days becose of this code.

  • @wixwixy3025
    @wixwixy3025 4 года назад

    Thanks for the tutorials - amazing stuff! Have used your search box tutorial as well as the dropdown one above to great success (on the same page) .
    I was wondering if it's possible to display more 'fields' from the database on a page, whilst using the dropdown as a trigger?
    thanks again!!

    • @phpBasics
      @phpBasics  4 года назад +1

      You can, but you would need to introduce JQUERY or another AJAX wrapper since PHP doesn't update in real-time.

  • @iamsarb_0017
    @iamsarb_0017 3 года назад

    how to insert value from dropdown list to database(from php code to database just like different country name in list select it & stored in database )??

    • @phpBasics
      @phpBasics  3 года назад

      You would give the select tag a name and process it like a normal form value.

  • @neymat3257
    @neymat3257 4 года назад

    Thank you sir 👍

  • @mayazoughbi6224
    @mayazoughbi6224 4 года назад

    its not taking from the database all content its only taking one from it what should i do? example from departments its taking accounting.

    • @phpBasics
      @phpBasics  4 года назад

      Hi Maya, feel free to reach out on Skype: Cooleditz

  • @KingVega73
    @KingVega73 6 лет назад

    Great Video. I am searching a solution with a problem I am stuck in and maybe your code can help, but i need some more suggestion. Imagine to have a database with the classical fields State, Cities address, telephone, email, ecc... I wish that a the name of the state appears only once and add a dropdown with all the cities and when a city is selected, all the other fields showing the correct value. Thanks in advance.

    • @phpBasics
      @phpBasics  6 лет назад

      Greetings. You will need to download and import a database of cities and states. The rest could be done with JQUERY and AJAX. Things like this are typically done with .NET, PYTHON, or Ruby on Rail. However, I've done it with PHP and JQUERY and it does the job. If you have Skype, we may be able to work through it together.

    • @KingVega73
      @KingVega73 6 лет назад

      Hi. Thanks foer your fast answer. I have already my own db with all the fields i told you before, the problem is that while i have some basic knowledge of PHP my culture on JQUERY and AJAX is more than limited... Yes I have skype. If is not a problem for You, just send me your username there and i will contact You if it's not a problem.

    • @phpBasics
      @phpBasics  6 лет назад

      CoolEditz

  • @พิชาภพบุญฑล
    @พิชาภพบุญฑล 4 года назад

    THANK YOU SO MUCH, from thai.

  • @sleepyScush11ie_
    @sleepyScush11ie_ 4 года назад

    is there a python way to do this ?

  • @mohamudrashid4528
    @mohamudrashid4528 4 года назад

    what if you want to save the selected item in another table

    • @phpBasics
      @phpBasics  4 года назад

      You name of the option passes through the form. Save it to whatever table you want after you process it.

  • @lakruwansenadheera
    @lakruwansenadheera 3 года назад

    how can we do it on android studio? please help

  • @cjellal
    @cjellal 6 лет назад

    How can i retain them after I press the submit button sir?

    • @phpBasics
      @phpBasics  6 лет назад

      I believe I have a video on that.

  • @markwoodard4640
    @markwoodard4640 5 лет назад

    Thank you!

  • @DidYouKnowDaily786
    @DidYouKnowDaily786 4 года назад

    Thank you so much Bro

  • @nurnaafizahmohammadrapi9285
    @nurnaafizahmohammadrapi9285 3 года назад

    huhuuu, i am beginner i still get stuck doing this, i followed your step sudah..whats wrong with my code , can u help me

    • @nurnaafizahmohammadrapi9285
      @nurnaafizahmohammadrapi9285 3 года назад

      Warning: mysqli::mysqli(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: NO) in C:\Program Files (x86)\Ampps\www\Test111\Index.php on line 3
      Warning: mysqli::query(): Couldn't fetch mysqli in C:\Program Files (x86)\Ampps\www\Test111\Index.php on line 5

    • @nurnaafizahmohammadrapi9285
      @nurnaafizahmohammadrapi9285 3 года назад

    • @phpBasics
      @phpBasics  3 года назад

      @@nurnaafizahmohammadrapi9285 You aren't connecting to the database correctly. The password for root is incorrect.

  • @sedawattacargo5482
    @sedawattacargo5482 5 лет назад

    Thank you

  • @kennyrobertson9027
    @kennyrobertson9027 4 года назад

    Hey, thank you, it works for me. Now I am trying to save dropdown data over multiple pages but are unable to keep the data when I go back to the previous page, please help.

    • @phpBasics
      @phpBasics  4 года назад

      Send me a message on skype: CoolEditz

  • @fitriantoadipratama4269
    @fitriantoadipratama4269 4 года назад

    Thanks bro,

  • @deepakkumarthangavel9574
    @deepakkumarthangavel9574 2 года назад

    Thanks bro it helped me

  • @aymanmustafa2378
    @aymanmustafa2378 4 года назад

    dude, would be great if you provide your code so we can copy and paste it.

    • @phpBasics
      @phpBasics  4 года назад

      The idea behind this channel is to teach people how to code, not provide free source code for lazy people.

  • @corinal73
    @corinal73 4 года назад

    thank you!!

  • @talhamuneer2599
    @talhamuneer2599 5 лет назад

    Thanks A Lot Man!

  • @tiesfa
    @tiesfa 5 лет назад

    I keep getting PHP error 500... Trying to fix it, thanks for the good tutorial tho!

  • @Beastboy9x
    @Beastboy9x 5 лет назад

    Thankss, u save my life man

  • @traveldiaries3266
    @traveldiaries3266 5 лет назад

    Thank a lot...it worked..

  • @КатанычТВ
    @КатанычТВ 3 года назад

    thank you from russia!

  • @arung8344
    @arung8344 4 года назад

    It worked. .

  • @nizamersoft
    @nizamersoft 5 лет назад

    This video is useless as it does not teach us how to display name in frontend but insert its id in database when form is submitted.

  • @90MSB
    @90MSB 3 года назад

    Thank you

  • @shalombentenzingnamchyo9384
    @shalombentenzingnamchyo9384 2 года назад

    Thank you