Datatabase error: Commands out of sync

This seems to be a problem with “orphaned SELECT statements”. It is described here in more detail.

One solution would be to create a temporary table and modify my_acquireuserpasswd to save data to temp_table

BEGIN
  DECLARE passwdtemp VARCHAR(64);
  DECLARE temp VARCHAR(4000);
  START TRANSACTION;
    SELECT id, passwd INTO uid1, passwdtemp FROM users WHERE name = name1;
    SET temp = fn_varbintohexsubstring(1,passwdtemp,1,0) ;
    INSERT INTO temp_table (pstrout) VALUES (temp); 
  COMMIT;
END

Assuming $my_db_connect is $wpdb object, you can retrieve the data in your php function using something like:

     $GetSvrPass = $my_db_connect->get_var ( 'SELECT * FROM temp_table' );
     $my_db_connect->query ( 'DELETE FROM temp_table' );

Deleting values from temp_table at every function call is of course optional, you might simply add ID’s or implement some other solution.