[DiscordArchive] what is the character? new, old, race, class?
[DiscordArchive] what is the character? new, old, race, class?
Archived author: M'Dic • Posted: 2023-03-05T19:25:46.743000+00:00
Original source
what is the character? new, old, race, class?
Archived author: M'Dic • Posted: 2023-03-05T19:26:14.128000+00:00
Original source
and when u say crash, u mean the world server or the client side?
Archived author: may • Posted: 2023-03-05T19:27:22.962000+00:00
Original source
In order to merge two spell.dbc tables, I asked chatGPT to write a tool for me....
```cpp
import mysql.connector
# 填写MySQL数据库连接信息
config = {
'user': 'username',
'password': 'password',
'host': 'localhost',
'database': 'database_name'
}
# 连接MySQL数据库
cnx = mysql.connector.connect(**config)
cursor = cnx.cursor()
# 填写需要合并的表名
source_table = 'table_a'
target_table = 'table_b'
# 获取表结构信息
cursor.execute("DESCRIBE "+source_table)
source_table_schema = cursor.fetchall()
column_names = [column[0] for column in source_table_schema]
# 生成插入数据的SQL语句
insert_query = "INSERT INTO "+target_table+" ("+", ".join(column_names)+") VALUES ("+", ".join(["%s"]*len(column_names))+")"
# 从源表中获取数据
select_query = "SELECT * FROM "+source_table
cursor.execute(select_query)
data = cursor.fetchall()
# 将数据插入目标表
cursor.executemany(insert_query, data)
cnx.commit()
# 关闭数据库连接
cursor.close()
cnx.close()```
![[Image: image.png?ex=690c4e1a&is=690afc9a&hm=d91...8f1df5bd8&]](https://cdn.discordapp.com/attachments/284406375495368704/1082021825988538510/image.png?ex=690c4e1a&is=690afc9a&hm=d9175aaeb29e05d77f6c312cfd700f0f83df4139420a338bf3622c58f1df5bd8&)
Archived author: M'Dic • Posted: 2023-03-05T19:28:26.362000+00:00
Original source
```cpp
makes it all look prettier
```
![[Image: image.png?ex=690c4e1a&is=690afc9a&hm=d91...8f1df5bd8&]](https://cdn.discordapp.com/attachments/284406375495368704/1082021825988538510/image.png?ex=690c4e1a&is=690afc9a&hm=d9175aaeb29e05d77f6c312cfd700f0f83df4139420a338bf3622c58f1df5bd8&)
Archived author: M'Dic • Posted: 2023-03-05T19:29:51.037000+00:00
Original source
```cpp
# 填写MySQL数据库连接信息
config = {
'user': 'username',
'password': 'password',
'host': 'localhost',
'database': 'database_name'
}
# 连接MySQL数据库
cnx = mysql.connector.connect(*config)
cursor = cnx.cursor()
# 填写需要合并的表名
source_table = 'table_a'
target_table = 'table_b'
# 获取表结构信息
cursor.execute("DESCRIBE "+source_table)
source_table_schema = cursor.fetchall()
column_names = [column[0] for column in source_table_schema]
# 生成插入数据的SQL语句
insert_query = "INSERT INTO "+target_table+" ("+", ".join(column_names)+") VALUES ("+", ".join(["%s"]len(column_names))+")"
# 从源表中获取数据
select_query = "SELECT * FROM "+source_table
cursor.execute(select_query)
data = cursor.fetchall()
# 将数据插入目标表
cursor.executemany(insert_query, data)
cnx.commit()
# 关闭数据库连接
cursor.close()
cnx.close()`
```
Archived author: M'Dic • Posted: 2023-03-05T19:29:57.480000+00:00
Original source
cpp adds color
Archived author: may • Posted: 2023-03-05T19:33:46.050000+00:00
Original source
However, my original intention was to handle one thing simply, but now it becomes more complicated, and I need to learn Python
Archived author: mynameismeat • Posted: 2023-03-05T19:47:49.059000+00:00
Original source
python is fun, good luck