mal()
and inserting into databases really depends on which database you are using. For MySQL, check out mysql_query() and www.mysql.com
Also search these forums. You'll find TONS of answers for both of these questions along with sample code.
If you're familiar with C, then PHP syntax is no stranger to you. PHP.net is an awesome resource, especially with your C background. All the documentation is there. Post back if you run into any problems.
Cgraz