*********test.php**************
******************************
<form action="/forums/test_records.php" method="post" name="test" id="test">
<table width="385" border="1" align="center">
<tr>
<td width="120">Date: </td>
<td width="249"><?PHP echo date("Y-m-d");?></td>
</tr>
<tr>
<td>Particulars:</td>
<td><input name="Particulars" type="text" size="40"></td>
</tr>
<tr>
<td>Debit:</td>
<td><input name="Debit" type="text" size="40"></td>
</tr>
<tr>
<td>Credit:</td>
<td><input name="Credit" type="text" size="40"></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<input type="submit" name="Submit" value="Submit">
</div></td>
</tr>
</table>
</form>
***********test_records.php*************
****************************************
<?php
include 'connect/connection.php';
if (isset($_REQUEST['Submit']))
{
$sql = "INSERT INTO test( Date, Particulars, Debit, Credit, sum_of_debit, sum_of_credit, Balance) values ( NOW(),'".($_REQUEST['Particulars'])."', '".($_REQUEST['Debit']))."', '".($_REQUEST['Credit']))."' ,'".($_REQUEST['sum_of_debit'])."' ,'".($_REQUEST['sum_of_credit'])."' ,'".($_REQUEST['Balance'])."')";
$result = mysql_query($sql) or die (mysql_error());
}
Now my query is about that i have only four text fields in test.php through which i insert data into the database, but there in database i have 7 fields,
i just wana to insert record without using the text fiels and as well as find out the sum_debit and sum_credit from debit and credit fields respectively, and i m not sure that the above request is correct or not that i declared in the above test_records.php and the Balance field should be the result of sum_credit - sum_debit.
Plz help in this code....
** Will thankful to u ***