Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Step1: Select concatenated PK with combined composite key
- $g->select_command = "SELECT concat(Year_No,'-',Order_No,'-',LocationID,'-',TranscationId) as pk, Year_No, Order_No, LocationID, TranscationId, Startdate, ExpiredDate FROM mylocations ";
- Step2: Connect on_update event hander
- $e["on_update"] = array("update_data", null, false);
- $g->set_events($e);
- Step3: In handler, split the PK with your sep, and make custom UPDATE query
- function update_data($data)
- {
- list($Year_No,$Order_No,$LocationID,$TranscationId) = explode("-",$data["pk"]);
- $s = array();
- foreach($data["params"] as $k=>$v)
- {
- $s[] = "$k = '$v'";
- }
- $s = implode(",",$s);
- $w = "Year_No=$Year_No and Order_No=$Order_No and LocationID=$LocationID and TranscationId=$TranscationId";
- $result1 = mysql_query("UPDATE mylocations set $s WHERE $w");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement