diff models/extractapp.php @ 102:6ba742b712b0 extractapp

new: use cookie in browser to trigger auto refresh page in LGServices
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Wed, 25 May 2016 11:29:28 +0200
parents a264460c77ca
children e542b161d907
line wrap: on
line diff
--- a/models/extractapp.php	Wed May 04 15:22:11 2016 +0200
+++ b/models/extractapp.php	Wed May 25 11:29:28 2016 +0200
@@ -905,7 +905,7 @@
              // for creationDate and lastChangeDate
             $date = date('Y-m-d H:i:s', time());
 
-            $query1 = sprintf("INSERT INTO `Taglist` (`id`, `name`, `tag`, `color`, `creationDate`, `lastChangeDate`) VALUES (%s, %s, %s, %s, %s, %s)",
+            $query1 = sprintf("INSERT INTO Taglist (`id`, `name`, `tag`, `color`, `creationDate`, `lastChangeDate`) VALUES (%s, %s, %s, %s, %s, %s)",
                                 $this->GetSQLValueString($id, "int"),
                                 $this->GetSQLValueString($name, "text"),
                                 $this->GetSQLValueString($tag, "text"),
@@ -915,7 +915,11 @@
                                 //$this->GetSQLValueString($this->systemNAME, "text"));
             
             $result1 = mysql_query($query1);
-
+            if (!$result1) {
+                //echo json_encode("error when insert into Taglist table");
+                echo 0;
+                return;
+            } 
 
             // add it to topic_tag_relation table
             $topic_id = $postdata['topic_id'];
@@ -932,8 +936,10 @@
 
             $result = mysql_query($query);
             if (!$result) {
-                echo json_encode("error when insert into TopicTagRelation table");
+                echo 1;
+                //echo json_encode("error when insert into TopicTagRelation table");
             }
+        
         }
 
     }