Select from Drop-down list and display MySQL data on PHP page using AJAX query.
HTML-код
- Опубликовано: 30 сен 2024
- First fill the dropdown with data from mysql. Use AJAX query in onchange() function() to fetch and display adequate data.
link for google api:
ajax.googleapi...
IT Finally Worksss !!!1 Thank YOU!!! ❤❤❤
What if I want to show more tables and drop downs on the side?
It would be good if you provide github repo link of such codes in the description of your videos.
Bro it's not working ..
I write "echo $sql" in the end but the problem that happened to you stayed with me ...
Give me solution pleease
Exactly what I was looking for. Thank you so much Raj!!!
Great tutorial, I would like to leave this suggestion for all who is going to implement this fantastic tutorial. Remove echo $sql at 29:25 and use $k = ( isset ( $_POST[ 'id' ] ) ? $_POST[ 'id' ] : '' ); at 24:09
how to show data in input field already on page ?
tried the same code but mine does not display results when searched
Good job !
But today is Better to code with PDO. In fact, and you know that, the code can be swift between different system, and not only MySQL.
Would you, for your next code to be published, do that with PDO. !!! Not only for me, but for all coder how are looking for some PHP code !!!
Cheers...
What if I want to show data with 5 drop-down list
Hi, may i know why is twice? thanks in advance
I tried this code but
echo $sql the output is SELECT * FROM students WHERE sec_id = *
I really need this kind of code for my capstone project can you help me? I can't display data 😰
Urgent Urgent!!!!!- Excellent but i got an error msg "Warning: Undefined array key "id" in D:\xampp\htdocs\lesson\lesson1\showdata.php on line 2"
Same error ! Did you get any solution for the same ?
Thanks! This helped me to customize a crucial and difficult piece of my program. This is a great instructional video.
Thank you
Perfect tut, great work Big Raj
Thank you so much for this great video.
But how if I want to add information for the second mobile without removing the information for the first mobile? ... means I have to add a dynamic table row..
Can you help me with this please?information
How to do the same thing with a "Sidebar" or a "Navbar" instead of dropdown list..... Please Help !!
hi, nice job... source code?
Thank you very much for this tutorial, i have a question about if i want to pass the ajax response call data to another PHP file is it possible i tried sessions but it didn't work e.g $_SESSION[something] = $row[something]; (it didn't work) is there any other way to pass the data!!
Great tut. Exactly what I was looking for and simply explained. Thanks!
Awesome tutorial! I'm trying to do this with boxes though and I can't find a tutorial online _anywhere_ that shows how to do that. I'm looking and asking everywhere for help, so I'm asking for help with it here too. I asked on StackOverflow but some asshole commented "you're doing javascript, not database." and shut my question down (closed it) although there's ZERO javascript in the code I shared and I didn't type the word database even once in my question or title text. The question wasn't even posted for an hour and got zero answers or (helpful) comments.
F%*K Stackoverflow!
ruclips.net/video/29pVT2UoC6g/видео.html Check with this...it may be helpful...
Raj you are a genius sir. I'm working on a project and this was exactly what I was looking for.
Great work. It is very helpful and step by step explanation made it easy to understand. Thank you.
thank you for the Video, but how I can add Select all to dropdown list?
Great video. I actually made it work on the first try! The only thing that would be nice is explanation on where the content goes if it's not inside a table.
It works great, but only one time. If I try to select from the dropdown and it crashes. If I refresh the page 2 or 3 times, it works.
Is there a way to clear the cache after a selection?
Sir i want to fetch particular data under select tag which are stored in different tables...Please help me out
Waw, I really appreciated it! Thank you Raj Bhise
I keep getting Failed to load resource: the server responded with a status of 500 () after selecting an option in the dropdown
check if you have installed php-mysql connector...
nice bro but can i contact with u cuz i have a problem in my code
Your actually the goat, This helped so much thank you.
can you please show how to add pagination on this code
how can we use database tables as options in dropdown menu to insert data in selected table....?
how to do same thing in laravel??
if I were to add a filter for the model and show the data related to the filter, what should I do?
very useful becuse of this i resolve my issue very easly thank uhh
Thank you very much Brother
Hi There, Thank you for the tutorial. I have used it in WordPress to develop a plugin and I am experiencing small issue with CORS: I am getting the following error Access to XMLHttpRequest at '' from origin ': Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
When I use the CORS extension on my browser and disable it (CORS) works but only on my browser: Could you please help me resolve this issue.
hi sir had you succed to develop your plug in ? seems there is no such plug in (as i know ), if it is , could you share it please ? i need it, just answer me even you don;t want to share thank you
Thank you so much, man! It helped me a lot😊
sir great video. Thank you sir
Data not display without showing any error. How?
Enable error reporting by adding the following code:
ini_set('display_errors',1);
Preferably at the start of the page. It will display the error, if any.
Thankyousomuch sir!
Thank you, sir. I appreciate slower pace so that also beginners can keep up with it.
how do we edit the displayed data?
Amazing! I got it to work for me! THANKS!
Really helpful video. Is it possible to display the data in a text field instead of creating a table? I am looking to select a specific id from the database and display only the corresponding product name. Thanks in advance for any help.
Yes you can!
ruclips.net/video/29pVT2UoC6g/видео.html
I am facing some problem can i share with you
yes you can.
Thanks
hi , thank you for this tutorial, i have just one question: is it posible to select one of the output rows and add it into a form?
Hello! Were you able to solve this problem? I am having the same one
Yes it is. Will share the link soon.
Fantastic !!!!!!!
Bro it's not working for 2 selector combobox
can you clarify 2 selector combobox
@@rajbhise8586
I mean how to use 2 two drop-down list ??
Perfect!
really helpful brother.. god bless you.
Thanks for the tutorial. I had the dropdown list populating but now am getting an error related to the page you called showBrand. As you did I also echoed out the sql statement and it is breaking it because it does not recognise the $k variable.
$k = $_POST['id']; // line 3
$k = trim($k);
$con = mysqli_connect("localhost", "root", "password", "oct2020project");
$sql = "SELECT * FROM links WHERE subject='{$k}`";
echo $sql;
The output from the echo is
SELECT * FROM links WHERE subject='`
This is happening because I am getting
Notice: Undefined index: id in C:\xampp\htdocs\dependantdropdown2021\dependantdropdown\showlinks.php on line 3
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in C:\xampp\htdocs\dependantdropdown2021\dependantdropdown\showlinks.php on line 13
while($rows = mysqli_fetch_array($res)){ ?> //Line 13
I am using a table called links. Where you used brand I used subject.
PLEASE USE $id = (isset($_POST['id']) ? $_POST['id'] : '');