This topic is locked
[SOLVED]

 Insert on same table after edit

3/14/2014 3:10:11 AM
PHPRunner General questions
C
chrispa author

Hi,
i need when i edit a record and click save to create a new entry on same table
more specific
i have table
tbltodo
when i edit i need but cannot manage to insert a new entry with same data on same table not insert to other table but, expiredate get the value of newexpiredate is it that possibly? thanks
global $conn;
$strSQLInsert = "insert into tbltodo (description,vessel,expiredate,visible) values ('".$data["description"]."','".$data["vessel"]."',,'".$data["NewExpireDate"]."','Yes')";

db_exec($strSQLInsert,$conn);

Sergey Kornilov admin 3/14/2014

It's a bit hard to understand what exactly you saying but if use event like AfterEdit instead of variables like $data["description"] you need to use $values["description"].

C
chrispa author 3/15/2014



It's a bit hard to understand what exactly you saying but if use event like AfterEdit instead of variables like $data["description"] you need to use $values["description"].


THANKS A LOT