This topic is locked

automated Table fill

11/29/2007 7:26:03 PM
PHPRunner General questions
D
Daktarie author

i have 2 tables with almost exact the same fields
table 1 xx.yy,zz, a,b,c,d .....so on (the user will fill it)
table 2 a,b,c,d .....so on (the user will fill it)
table3 is the one i need to be filled

with the differents between table 1 a,b,c,d and table 2 a,b,c,d without the xx,yy,zz data of table1
will custom vieuw store the data in table 3 and more important how do i do it

Alexey admin 11/30/2007

Hi,
please claify when you need to save data to table3 and what data should be saved.

D
Daktarie author 12/1/2007

i want to at data from table 2 minus data from table 1 in to table 3
for example table 1 pang=10%

table 2 pang=40%

table 3 pang= table 2 pang - table 1 pang ...=pang=30%
i have to do that when table 2 will be filled but can't find out where is the best place to make the calculation

so some pointers would be great.
global $conn,$strTableName;
$strSQLSave = "INSERT INTO AnotherTable (Field1, Field2) values (";
$strSQLSave .= $values["Field1"].",";

$strSQLSave .= $values["Field2"];
$strSQLSave .= ")";

db_exec($strSQLSave,$conn);