如何使用PHP将数据库数据返回到现有的HTML页面?

I am new to PHP. I know a little JavaScript, HTML, MySQL and lots of non-web computer programming.

I know how to create an HTML page with a form, use a button to call an external PHP file (with $_POST) which sends an email and records that forms data (names and email addresses) into a MySQL database.

Now, I'd like to create a new HTML page that calls an external PHP file (so the code is hidden) that will return the MySQL data (names and email addresses) for display on that existing HTML page (with all its CSS formatting and menus). In otherwise, I'd like to modify an existing HTML page with data (but hide the PHP code in an external file).

If this can be done (I'm new to this), can some please help by giving me at least the general idea so that I can build upon it. The textbooks that I've flipped through simply explain how to "echo" data back to the screen (a blank screen) with a .php extension in the address bar.

Thank you very much for your time and any help. I appreciate it!

Since you already have the html to echo part, you'll just need to plug it into the database.

Using a good ORM can help with this. For PHP, I recommend starting with Propel:

http://propelorm.org/

Once you get a bit more comfortable with that, you might want to try using a PHP framework, like Symfony, to help you structure the project in a more uniform way. However, there are many other PHP frameworks out there, so try to evaluate the top ones before settling on a favorite.

Furthermore, the examples provided in PHP framework documentations will guide you through many of the common solutions (as a framework is just a toolkit built by people who have had to solve such problems over and over).

For example, here is the cookbook for symfony that outlines many solutions to common issues.