 				fs.readBytes(_publicKey, 0, 24); //Read public key into identity
 				fs.close();
 				
-				st.sql = "UPDATE users "
-				+ "SET `nearid`='"+_netConnection.nearID+"' "
-				+ "WHERE `key`=?;";
-				st.setBinary(1, _privateKey);
+				st.text = "UPDATE users "
+				+ "SET nearid="+_netConnection.nearID+" "
+				+ "WHERE key=@publicKey;";
+				st.parameters["@publicKey"] = _publicKey;
 			}
 			else //Register
 			{

	import com.maclema.mysql.MySqlToken;
	import com.maclema.mysql.ResultSet;
	import com.maclema.mysql.Statement;
	import flash.desktop.NativeApplication;
	import flash.errors.IOError;
	import flash.events.Event;
	import flash.events.EventDispatcher;
	import flash.events.IOErrorEvent;

	import flash.utils.ByteArray;
	import flash.utils.Timer;
	import sfxworks.services.DatabaseService;
	import sfxworks.services.events.DatabaseServiceEvent;
		
	import sfxworks.NetworkActionEvent;
	import sfxworks.NetworkEvent;
