[function f_set_mysphere_web] // You can put it on login or operate it with timer on item , whatever you like.
serv.MySqlDatabase=mysphere // I prefer to use my data seperately since sometimes is diffucult to maintain all of them in same database.Yet, you can neglect this part or change accordingly.
db.connect
db.execute delete from myrunuo_characters where char_id='<eval <uid>>' // Each time players want to see their paperdoll, data belong to player should be removed and replaced by the new one.
// Instead of deleting you can also update the content belong to uid like db.query update to related char_str,dex,guild so and so forth. But i would say that it is not convenient.
db.query insert into myrunuo_characters (char_id, char_name, char_str, char_dex, char_int, char_female, char_counts, char_guild, char_guildtitle, char_nototitle, char_bodyhue, char_public) VALUES ('<eval <uid>>', '<addslashes <name>>', '<str>', '<dex>', '<int>', '<sex>', null, '<guild>', null, '<title>', '<eval <color>>', null) // Character Informations, you can adjust if there is missing part.
db.execute delete from myrunuo_characters_layers where char_id='<eval <uid>>' // Removing layers to replace again in order not to duplicate.
// Inserting data of layers from <src>
for x 1 24
if <findlayer.<dlocal.x>>
ref1 = <findlayer.<dlocal.x>.uid>
db.query insert into myrunuo_characters_layers (char_id, layer_id, item_id, item_hue) VALUES ('<eval <ref1.cont.uid>>','<dlocal.x>','<eval <ref1.id>>','<eval <ref1.color>>') //
endif
endfor
// Character skills
for x 1 49
db.query insert into myrunuo_characters_skills (char_id, skill_id, skill_value) VALUES ('<eval <uid>>','<dlocal.x>','<<def.player_skill_<dlocal.x>>')
endfor
db.close
serv.MySqlDatabase=sphere // Changing default mysql database set in sphere.ini in order not to cause any problems.