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!
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
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.
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.
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?
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
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
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.
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?
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.
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!!
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 )??
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.
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.
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.
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
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.
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!
you are teaching very well sir thank you
It worked, I was hitting my head against a wall before I've found this video. Thanks pal.
Much love from Jamaica. This is exactly what I was looking for and the video is very short. *Gracias*
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
a simple and practical example, thanks for the video
A small tip if using bootstrap then dont' forget to add class="custom-select mr-sm-2" id="inlineFormCustomSelect" in the select tag
Simple but powerful. Thanks a lot.
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?
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.
Nice one very good explanation
Would love to see more videos on PHP PDO and advanced topics connecting Front and Backend
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.
Yep, that's very doable in a variety of ways. Hit me up on Skype if you want to discuss it further - CoolEditz
@@phpBasics I appreciate it - I'll reach out sometime this week.
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?
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
very simple, the best simple one ever.
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
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.
Hello thank you for the tutorial. How can I give the dropdown a scroll bar?
Very concise. Thanks a lot
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?
You're the best! Thanks so much
Can we populated it in sign up form which will comes from plugin.
If possible then please let me know.
simple and nice, thank you!
👏 👏 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?
I have a tutorial on that coming up shortly! If you need some help, send me a message on Skype: CoolEditz
Thank you very much!
Big thank you bro
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?
Send your source code to phpbasics@yahoo.com and I'll take a look at it.
thank u so much it was super easy and very helpful
Thank you very much buddy!! This helped alot!! Explained precisely. Thanks again!
THANK YOU SO MUCH. You literally saved me! Thanks man!
Great tutorial! But can you show how to do this with an external PHP file if this is possible in some way?
External php file?
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.
That's what I'm demonstrating in this video. If you're still having issues, you can hit me up on Skype: CoolEditz
@@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
How do you add the selected value to a new table
You're a God. Thank you for this
Thank you so much sir. You helped me . I was blocked for two days becose of this code.
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!!
You can, but you would need to introduce JQUERY or another AJAX wrapper since PHP doesn't update in real-time.
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 )??
You would give the select tag a name and process it like a normal form value.
Thank you sir 👍
its not taking from the database all content its only taking one from it what should i do? example from departments its taking accounting.
Hi Maya, feel free to reach out on Skype: Cooleditz
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.
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.
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.
CoolEditz
THANK YOU SO MUCH, from thai.
is there a python way to do this ?
what if you want to save the selected item in another table
You name of the option passes through the form. Save it to whatever table you want after you process it.
how can we do it on android studio? please help
How can i retain them after I press the submit button sir?
I believe I have a video on that.
Thank you!
Thank you so much Bro
huhuuu, i am beginner i still get stuck doing this, i followed your step sudah..whats wrong with my code , can u help me
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 You aren't connecting to the database correctly. The password for root is incorrect.
Thank you
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.
Send me a message on skype: CoolEditz
Thanks bro,
Thanks bro it helped me
dude, would be great if you provide your code so we can copy and paste it.
The idea behind this channel is to teach people how to code, not provide free source code for lazy people.
thank you!!
Thanks A Lot Man!
I keep getting PHP error 500... Trying to fix it, thanks for the good tutorial tho!
Thankss, u save my life man
Thank a lot...it worked..
thank you from russia!
It worked. .
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.
Thank you
Thank you