as akido said the simplest solution is to use phpmyadmin... if you must do the things from within php, you should read a sql manual (mysql.com) because there are different ways to insert and retrieve data, read about
- CREATE DATABASE database_name
- INSERT INTO table_name
- SELECT ... FROM table_name (WHERE ...)