From 9c833cbaa6b865dda14760b7f448467ec1a912d6 Mon Sep 17 00:00:00 2001 From: niekt0 Date: Mon, 28 Mar 2011 00:10:53 +0200 Subject: [PATCH] set_synapse fix --- wwwroot/backend/mysql/backend.inc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wwwroot/backend/mysql/backend.inc b/wwwroot/backend/mysql/backend.inc index 6bc454b..bdc8515 100644 --- a/wwwroot/backend/mysql/backend.inc +++ b/wwwroot/backend/mysql/backend.inc @@ -364,13 +364,13 @@ function setSynapse($params){ $weight=$params['weight']; // if already exists - $q="select src from neurons where dst ='$dst' and src = '$src'"; + $q="select count(src) from neurons where dst ='$dst' and src = '$src'"; $set=$db->query($q); $set->next(); - $isrc=$set->getString('src'); + $isrc=$set->getString('count(src)'); - if ( $isrc ) { - $q="update neurons set synapse_weight='$synapse_weight' + if ( $isrc > 0 ) { + $q="update neurons set synapse_weight='$weight' where dst = '$dst' and src = '$src'"; } else { // FIXME no vector set -- 2.30.2