# HG changeset patch # User peter # Date 1216052370 0 # Node ID 4066e4c0de01ecc5c04b371b4e2274d082b04a06 # Parent ae77a8f97ee23e0f20f1bf306ac5a409355289bb [feladat @ 297] Bugfix: removed the multirow insert syntax, which is only supported in PostgreSQL 8.2 and higher. Reported and patch by grin. This closes ticket:79. diff -r ae77a8f97ee2 -r 4066e4c0de01 inc/users.inc.php --- 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; }