Skip to content
Advertisement

How do I open modal using bootstrap 4 by clicking a hyperlinked table cell and populate data in the model from SQL database using the clicked ID

I have a page which displays data from SQL in a table and on that table one cell is hyperlinked and I want a modal (using bootstrap) to open and fetch data using the ID (the hyperlink value) and populate with data on the body in modal from SQL. I have tried different approaches but none is working well. The modal opens up but its not prominent as if its opening in background. Please help me with this.

Used Links in HEAD:

JavaScript

PHP Code

JavaScript

How do I pass the ID to the modal and where should I initialize the modal passing the ID (hyperlink) to populate the modal with data using the ID with PHP script?

enter image description here

Advertisement

Answer

JavaScript

Ajax Code:-

JavaScript

select.php:-

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement