get_k_neurons added (not working so far)
[mirrors/Kyberia-bloodline.git] / wwwroot / backend / mysql / backend.inc
index f8cd6a3fec998f83318162a8ee967ecc58dc1e51..7b6537221a32c7fd731c9cc44d16163084aa2286 100644 (file)
@@ -307,20 +307,20 @@ node_parent='$node_handle' order by node_created $orderby LIMIT $offset,$limit";
 
 // Simple internal function to set node parrent
 
-function setParent($params) {
+function setParent($node_id,$parent_id) {
         global $db,$node,$error,$error_messages;
-        $parent_id=$params['node_parent'];
-        $node_id=$params['node_id'];
 
         if (!is_numeric($parent_id)) {
                 return false;
         }
-       $q="select node_vector from nodes where node_id='$parent_id'";
-       $parent_vector=$db->query($q);
 
-       $new_vector=$parent_vector.str_pad($node_id,VECTOR_CHARS,"0",STR_PAD_LEFT);     
-       $q="update nodes set node_parent='$parent_id',node_vector='".$new_vector."
-               ' where node_id='$node_id'";
+        $q="select node_vector from nodes where node_id='$parent_id'";
+        $set=$db->query($q);
+        $set->next();
+        $parent_vector=$set->getString('node_vector');
+        $new_vector=$parent_vector.str_pad($node_id,VECTOR_CHARS,"0",STR_PAD_LEFT);
+
+       $q="update nodes set node_parent='$parent_id',node_vector='$new_vector' where node_id='$node_id'";
        $db->query($q);
 }
 
This page took 0.148161 seconds and 4 git commands to generate.