Hello, I am still quite new to php, but me and a couple of others are using PHP for a website we are working on for our Uni project.
Heres what i have so far........
<html>
<body>
<?php
mysql_connect (localhost,elliott,password);
mysql_select_db ("quote");
mysql_query ("insert inTO main (applicant_id, firstname, surname, situation, title, dob, address, postcode, time_at_address,
previous_address, phone, work_phone, email, contact_time, employment, occupation, contract_length, service_length, accounts,
income_2001, income_2000, income_1999, income1, income2, total_income, ccj, ccj_details, bankruptcy, arrears, details,
lender, mortgage_outstanding, property_sold, loans_outstanding, monthly_payment, loan_expires, cards, cards_outstanding,
property_price, mortgage_req, mortgage_reason, urgency, other_info)
VALUES ('$_GET[applicant_id]', '$_GET[firstname]', '$_GET[surname]', '$_GET[situation]', '$_GET[title]', '$_GET[dob]',
'$_GET[address]', '$_GET[postcode]', '$_GET[time_at_address]', '$_GET[previous_address]', '$_GET[phone]', '$_GET[work_phone]',
'$_GET[email]', '$_GET[contact_time]', '$_GET[employment]', '$_GET[occupation]', '$_GET[contract_length]',
'$_GET[service_length]', '$_GET[accounts]', '$_GET[income_2001]', '$_GET[income_2000]', '$_GET[income_1999]',
'$_GET[income1]', '$_GET[income2]', '$_GET[total_income]', '$_GET[ccj]', '$_GET[ccj_details]', '$_GET[bankruptcy]',
'$_GET[arrears]', '$_GET[details]', '$_GET[lender]', '$_GET[mortgage_outstanding]', '$_GET[property_sold]', '$_GET[loans_outstanding]',
'$_GET[monthly_payment]', '$_GET[loan_expires]', '$_GET[cards]', '$_GET[cards_outstanding]', '$_GET[property_price]', '$_GET[mortgage_req]',
'$_GET[mortgage_reason]', '$_GET[urgency]', '$_GET[other_info]')
");
mysql_close;
mysql_connect (localhost, elliott, password);
mysql_select_db ("quote");
mysql_query ("UPDATE main SET mortgage_quote='$income'*3/0.95 WHERE email='$email'");
?>
</body>
</html>
Basically we want to take the details from the form into the table "main" but the final field in the table is called mortgage_quote, and this needs a formula which uses the value from the income field.
The update is probably all wrong, but i have not much idea on how to do it, and the books i have are pretty useless for this. The WHERE email bit is to try stick it in the same row as the form details etc.
If you can help with this thankyou very much, its much appreciated.