XAMPP installs Apache, php, mysql, phpmyadmin and several other packages for you.
I have never installed WAMPP, but I'm fairly certain that they also install the required packages as a one-click installer similar to XAMPP.
As for phpmyadmin creating php code, you will usually find that the 'create php code' selection is available on each step *after* you do something. You need to create any new databases yourself on the front page of phpmyadmin. They provide some sample databases, usually, and each install (should) include a 'test' database named 'test'.
For example, when you run phpmyadmin, and select a Database from the left hand column, then a table from the left hand column, it displays the table contents. The php code is available for the mysql query that is used to display the Table contents.
Likewise, after you use the Browse button, or after you enter some SQL code, it provides the option to have the php code displayed so that you can cut and paste it elsewhere.
As a 'beginner', it would be wise to install either WAMP or XAMPP since they remove many of the issues you would have by installing the components yourself.
After the package is installed, play around with the features. You really can't lose anything at the start. The worst thing might be having to re-install the whole thing, but not a biggie.