not working

46AND2's picture


I'm quite new into Drupal. I figured out how to get nodes, users etc. in my Flex app.

But I'm not able to update a user's profile or add a new user. The permissions are set correctly. I'm using "Keys" and "SessID". I have the following code:


<mx:RemoteObject showBusyCursor="true" destination="amfphp" source="user" id="user">
   <mx:method name="save" result="onSavedUser(event)" fault="onFault(event)" />

The saveUser function
public function saveUser(obj:Object):void {
  var hashedArray:Array = hashKey(""); // I use this method also for user.get etc, so I think it's not necessary to post it here[0], hashedArray[1], hashedArray[2], hashedArray[3], sessionID, obj);

The saveUser caller
var obj:Object = new Object();
obj.uid = 1; = "Haha User";
obj.mail = "";


In Drupal and Flex I have this error message:
Duplicate entry &#039;&#039; for key 2 query: INSERT INTO users (created, access) VALUES (1247317962, 1247317962) in /home/www/web153/html/Drupal/modules/user/user.module on line 327.

I thought if I add a uid to the passed object, Drupal should do an update and not an insert? I also tried to not pass the uid and then Drupal should create a new user, but I also get the same error message.

I appreciate every help on this. Thank you!


EDIT: I use Flex SDK 3 and Drupal 6.


C Sharp Interface Writer

anAgent's picture

Hi Everyone,

I created a console application that connects to a specified site and creates an interface based on the available services methods.

To read more about it and download the example, please visit:

To download the lastest package of my framework, please visit: