Here are some online samples for developer/design agreements:

http://www.wilsonweb.com/worksheet/pkg-con.htm
http://www.gallantrywebdesign.com/contract.html
http://www.orlandowebdevelopment.com..._agreement.htm

The contracts that I have written up in the past have the same major ideas incorporated into them:
Intellectual Property
Non-Competition
Standard Non-Disclosure Agreement
Non-Interference
A clear layout of what work will be done and how/when it will be compensated
Tax Responsibilities

You want to be a thorough as you can and it wouldn't hurt to hire a lawyer to review a contract for you or have one write up a good base agreement for you to work from.

Here are some phpmyadmin tutorials:
http://www.help.thinkhost.com/web-de...orial_357.html
http://faq.oneandone.co.uk/script_co...ses/php/4.html

And PHP:

http://www.devshed.com/c/b/PHP
http://webmonkey.wired.com/webmonkey/programming/php/
http://www.w3schools.com/php/default.asp

Best of luck!