This topic is locked
[SOLVED]

 Help With Copying data to the second table

3/20/2012 12:35:51 PM
PHPRunner General questions
B
bilboss author

hello, to make this code to copy in a second table when data is modified, only copy numeric data but the date is blank in the second table. I can help
global $ conn, $ strTableName;
$ strSQLSave = "INSERT INTO pol_ft (Date, Cod) values ​​(";
$ strSQLSave. = $ values ​​["Date"]. ",";

$ strSQLSave. = $ values ​​["Cod"];

$ strSQLSave. = ")";

db_exec ($ strSQLSave, $ conn);
este codigo esta en "before record updated"
thanks

C
cgphp 3/20/2012

The single quotes for fields values are missing:

global $conn, $strTableName;
$strSQLSave = "INSERT INTO pol_ft (Date, Cod) values('";
$strSQLSave. = $values​​["Date"]. "','";

$strSQLSave. = $values​​["Cod"];

$strSQLSave. = "')";

db_exec($strSQLSave, $conn);