How to combine PHP and HTML files to access/manipulate database : <p><strong>Goal:</strong></p>

<p>I am trying to create a web app that will access to my database, and be able to SELECT, INSERT, UPDATE and DELETE records. I am new to using databases and PHP, and have looked at other questions trying to make a breakthrough in my understanding, so please be kind and don't mark this as a duplicate.</p>

<hr>

<p><strong>Problem:</strong></p>

<p>I have an html file containing my webpage that is a scheduling tool, where users can plan meetings with others. I have created a database and understand the PHP code to manipulate that database, but I don't know where to do this.</p>

<hr>

<p><strong>Question:</strong></p>

<p>Say, for example, I have a PHP function that takes in a meeting time, and meeting description, and logs it into the database (not exactly what I'm trying to do but will be good enough for me to understand). I want it so that when a user clicks a segment on my page and logs in that meeting info, for it to call that PHP function and log in the data. Currently, I have one html file and 3 js files containing all the information for my page. I see that html information can be put into a php file, but not vice versa. So, do I:</p>

<p><strong>A.)</strong> Create a separate php file with all of the functions I will need to manipulate my database, and call those functions from my html and javascript files?</p>

<p><strong>B.)</strong> Create my entire page in a php file, rather than an html file, so I can intersperse snippets of php to manipulate my database?</p>

<p><strong>C.)</strong> I'm not understanding it correctly and there is something else I should do?</p>

<p>I understand this is a very basic question but I haven't found an answer that has enlightened me thus far, and I think this could be a useful question for beginners in the future.</p>
