Mercurial > hg > extraction-interface
diff develop/models/extractapp.php @ 20:04db1dd9d10d
update topic_regex_relation table when saving (new) regex file
author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
---|---|
date | Mon, 23 Feb 2015 14:34:43 +0100 |
parents | f60969462226 |
children | c805470cefee |
line wrap: on
line diff
--- a/develop/models/extractapp.php Mon Feb 23 12:46:03 2015 +0100 +++ b/develop/models/extractapp.php Mon Feb 23 14:34:43 2015 +0100 @@ -345,6 +345,16 @@ } file_put_contents( $data_path."regex_files/".$_postdata['filename'].".txt", $require); + + // update topic_regex_relation table + $topic_id = $_postdata['topic_id']; + $filename = $_postdata['filename'].'.txt'; + $query = "INSERT INTO topic_regex_relation (topic_id, regex_filename) VALUES (".$topic_id.",'".$filename."')"; + $result = mysql_query($query); + if (!$result) { + echo json_encode("error"); + } + } }