I need to insert records in the database but the conditions are:
for e.g:
When i am inserting some detail of a customer in the database i need to store his value information also. So his personal details are stored in one table and values are stored in another.
Now what i require is that for example if there is an ID field in the personal information table, i should have a field in the value information table which will store the same ID as that from the personal information table.
Like:
Note:kindly paste this code in your notepad and save it as abc.html so that you can view the table and what is required.Thanks
This is the
Personal Information Table.
<table style="text-align:center" width="382" height="111" border="1">
<tr bgcolor="#0099FF">
<th>ID</th>
<th>Name</th>
<th>Age</th>
</tr>
<tr >
<td bgcolor="#FFCC00">01</td>
<td>Max</td>
<td>26</td>
</tr>
<tr >
<td bgcolor="#FFCC00">02</td>
<td>Revan</td>
<td>27</td>
</tr>
<tr>
<td bgcolor="#FFCC00">03</td>
<td>Khan</td>
<td>28</td>
</tr>
</table>
Now This is the <b>VALUE INFORMATION TABLE.</b>
<table style="text-align:center" width="382" height="111" border="1">
<tr bgcolor="#0099FF">
<th>ID</th>
<th>Personal_ID</th>
<th>empno</th>
<th>F01</th>
<th>F02</th>
</tr>
<tr>
<td>101</td>
<td bgcolor="#FFCC00">01</td>
<td>123</td>
<td>1.01</td>
<td>2.02</td>
</tr>
<tr>
<td>102</td>
<td bgcolor="#FFCC00">02</td>
<td>124</td>
<td>1.02</td>
<td>6.32 </td>
</tr>
<tr>
<td>103</td>
<td bgcolor="#FFCC00">03</td>
<td>125</td>
<td>1.03</td>
<td>1.256</td>
</tr>
</table>
Now as we can see the
ID field of the
Personal Information Table is same like the
Personal_ID field of the
Value Information Table.
So whenever i insert a record in the same ID should be inserted in the Value Information Table automatically and PersonalInformationTable.ID is an auto-incrementing field which the database sets for me.
Any Help would be really appreciable.
Thanks.. :)
[Modified: fixed the pre tags]