I want create costume contact us page in my theme folder with database tables connections.
give me complete help for that.
In Drupal you would use web forms, a custom content type (plus rules) or a custom module to implement a custom contact form. One should not implement functionality at the theme layer.
Drupal is a registered trademark of Dries Buytaert.