phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] sync/inc/class.so_sync.inc.php, 1.25


From: nomail
Subject: [Phpgroupware-cvs] sync/inc/class.so_sync.inc.php, 1.25
Date: Fri, 21 May 2004 19:58:21 -0000

Update of /sync/inc
Modified Files:
        Branch: 
          class.so_sync.inc.php

date: 2004/04/26 14:58:04;  author: mkaemmerer;  state: Exp;  lines: +15 -10

Log Message:
- added error handling for delete device
=====================================================================
Index: sync/inc/class.so_sync.inc.php
diff -u sync/inc/class.so_sync.inc.php:1.24 sync/inc/class.so_sync.inc.php:1.25
--- sync/inc/class.so_sync.inc.php:1.24 Sun Apr 18 10:51:40 2004
+++ sync/inc/class.so_sync.inc.php      Mon Apr 26 14:58:04 2004
@@ -198,15 +198,20 @@
 
     function DeleteDevice($deviceid)
     {
-      // todo: error handling
-      $GLOBALS['phpgw']->db->query("DELETE FROM phpgw_syncdevices WHERE 
deviceid='".$deviceid."'",__LINE__,__FILE__);
-      
-      
-      $GLOBALS['phpgw']->db->query("DELETE FROM phpgw_syncdevices WHERE 
deviceid='".$deviceid."'",__LINE__,__FILE__);
-      $GLOBALS['phpgw']->db->query("DELETE FROM phpgw_syncchannels WHERE 
deviceid='".$deviceid."'",__LINE__,__FILE__);
-      
-      
-      return $GLOBALS['phpgw']->db->f('deviceid');      
+      $id = $GLOBALS['phpgw']->db->query("DELETE FROM phpgw_syncdevices WHERE 
deviceid='".$deviceid."'",__LINE__,__FILE__);
+      if (isset($id)) 
+      {  
+        $id = $GLOBALS['phpgw']->db->query("DELETE FROM phpgw_syncdevices 
WHERE deviceid='".$deviceid."'",__LINE__,__FILE__);
+        if (isset($id)) 
+        {  
+          $id = $GLOBALS['phpgw']->db->query("DELETE FROM phpgw_syncchannels 
WHERE deviceid='".$deviceid."'",__LINE__,__FILE__);
+          if (isset($id)) 
+          {
+            return $deviceid;
+          }
+        } 
+      }
+      return -1;
     }
 
     /******************************************************************/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]