0
Connecting html with php
I am trying to connect my database(php) with html file . Both has been created but they are not interconnected . So how can I connect them
2 Respostas
+ 2
If your site already uses PHP, PHP should connect directly to the database using extensions like PDO or mysqli.
mysqli example: https://www.w3schools.com/php/php_mysql_select.asp
You have 2 options for bringing data from the database to your web page.
1. Render the outputs in HTML when your page loads. In other words, echo it directly into the HTML written with your PHP script.
2. Use AJAX to fetch data from your PHP script, parse it, and do document model manipulation to make the results visible on your page. This will also require you to write a PHP script that returns JSON format.
It sounds like you've never used AJAX so use option 1.
0
Ok thanks