This question already has an answer here:
I have just installed MySQL and set up a server and a database. I have also created a table and insert data into it. Now I want to display this table on the web. I am planning to use this code https://www.w3schools.com/php/php_mysql_connect.asp to connect it to the web, but I don't know where to place this file for it to work. Can anybody help me? I'm really new to PHP and I have googled but everyone is using PHPMyAdmin.
</div>
Your concern is:
I don't know where to place this file for it to work.
You can place the file along with other files of your webpages. You will just need to include_once
or import
the file where you want database connection.
This is how you can use this:
<?php
include_once 'path_to_the_file/connection.php' //connection.php is the name of file in which you have written code for connectivity
//Now you can do the rest database activity here after
?>
As you said:
I'm really new to PHP and I have googled but everyone is using PHPMyAdmin.
phpMyAdmin
is a free software tool written in PHP
, intended to handle the administration of MySQL
over the web.
More information :
You can take help from video tutorials available on internet. There are thousands of tutorials to help you out of this.
I hope this will help you.