inc/users.inc.php
changeset 188 4066e4c0de01
parent 184 b60b88b1ae08
child 190 7a683326ccec
--- a/inc/users.inc.php	Sat Jul 12 13:44:34 2008 +0000
+++ b/inc/users.inc.php	Mon Jul 14 16:19:30 2008 +0000
@@ -610,11 +610,10 @@
 	$perm_templ_id = $db->lastInsertId('perm_templ', 'id');
 
 	foreach ($details['perm_id'] AS $perm_id) {
-		$r_insert_values[] = "(" . $db->quote($perm_templ_id) . "," . $db->quote($perm_id) . ")";
+		$query = "INSERT INTO perm_templ_items (templ_id, perm_id) VALUES (" . $db->quote($perm_templ_id) . "," . $db->quote($perm_id) . ")";
+		$result = $db->query($query);
+		if (pear::iserror($response)) { error($response->getmessage()); return false; }
 	}
-	$query = "INSERT INTO perm_templ_items (templ_id, perm_id) VALUES " . implode(',', $r_insert_values) ;
-	$result = $db->query($query);
-	if (pear::iserror($response)) { error($response->getmessage()); return false; }
 
 	return true;
 }
@@ -646,11 +645,10 @@
 	if (pear::iserror($response)) { error($response->getmessage()); return false; }
 
 	foreach ($details['perm_id'] AS $perm_id) {
-		$r_insert_values[] = "(" . $db->quote($details['templ_id']) . "," . $db->quote($perm_id) . ")";
+		$query = "INSERT INTO perm_templ_items (templ_id, perm_id) VALUES (" . $db->quote($details['templ_id']) . "," . $db->quote($perm_id) . ")";
+		$result = $db->query($query);
+		if (pear::iserror($response)) { error($response->getmessage()); return false; }
 	}
-	$query = "INSERT INTO perm_templ_items (templ_id, perm_id) VALUES " . implode(',', $r_insert_values) ;
-	$result = $db->query($query);
-	if (pear::iserror($response)) { error($response->getmessage()); return false; }
 
 	return true;
 }