Jump to content
  • 0

Query Sql (Copy a Table)


Zell

Question


  • Group:  Members
  • Topic Count:  53
  • Topics Per Day:  0.01
  • Content Count:  411
  • Reputation:   261
  • Joined:  04/25/12
  • Last Seen:  

Why this command don't work?
 

query_sql "INSERT INTO char_store (`char_id`,`account_id`,`char_num`,`name`,`class`,`base_level`,`job_level`,`base_exp`,`job_exp`,`zeny`,`str`,`agi`,`vit`,`int`,`dex`,`luk`,`max_hp`,`hp`,`max_sp`,`sp`,`status_point`,`skill_point`,`option`,`karma`,`manner`,`party_id`,`guild_id`,`pet_id`,`homun_id`,`elemental_id`,`hair`,`hair_color`,`clothes_color`,`weapon`,`shield`,`head_top`,`head_mid`,`head_bottom`,`robe`,`last_map`,`last_x`,`last_y`,`save_map`,`save_x`,`save_y`,`partner_id`,`online`,`father`,`mother`,`child`,`fame`,`rename`,`delete_date`,`moves`,`unban_time`) SELECT char_id,account_id,char_num,name,class,base_level,job_level,base_exp,job_ex,zeny,str,agi,vit,int,dex,luk,max_hp,hp,max_sp,sp,status_point,skill_point,option,karma,manner,party_id,guild_id,pet_id,homun_id,elemental_id,hair,hair_color,clothes_color,weapon,shield,head_top,head_mid,head_bottom,robe,last_map,last_x,last_y,save_map,save_x,save_y,partner_id,online,father,mother,child,fame,rename,delete_date,moves,unban_time FROM char WHERE `char_id`='"+getcharid(0)+"'";


I want copy all values of a player from table char to another called char_store, buts it's not working, so how can I?


Never mind, I already figure out

Edited by Zell
Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

You should have the same number of column in the 2 tables

insert into `charlog` select * from `char` where `char_id` = 150000

EDIT : you already solved it, forget it^^

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2346
  • Joined:  10/28/11
  • Last Seen:  

i think you can try use this too

http://www.w3schools.com/sql/sql_select_into.asp

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...