summaryrefslogtreecommitdiff
path: root/src/char_sql
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-09-12 21:30:03 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-09-12 21:30:03 +0000
commitef2ebfc6da2dac054af7dfe206bf1ea9906435ea (patch)
tree3d58cbd6d457b360eba7037bda9a7317a8b4a6fd /src/char_sql
parent3300d6861d4402be626816af041a8a1e1a1cfc48 (diff)
downloadhercules-ef2ebfc6da2dac054af7dfe206bf1ea9906435ea.tar.gz
hercules-ef2ebfc6da2dac054af7dfe206bf1ea9906435ea.tar.bz2
hercules-ef2ebfc6da2dac054af7dfe206bf1ea9906435ea.tar.xz
hercules-ef2ebfc6da2dac054af7dfe206bf1ea9906435ea.zip
- Improved sql-query to check if name already exists when creating new chars.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8727 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char_sql')
-rw-r--r--src/char_sql/char.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/char_sql/char.c b/src/char_sql/char.c
index cb0ebba89..2ffc16e9b 100644
--- a/src/char_sql/char.c
+++ b/src/char_sql/char.c
@@ -1390,7 +1390,7 @@ int make_new_char_sql(int fd, unsigned char *dat) {
// fd, dat[30], dat, dat[24], dat[25], dat[26], dat[27], dat[28], dat[29], dat[33], dat[31]);
//Check Name (already in use?)
- sprintf(tmp_sql, "SELECT `name` FROM `%s` WHERE `name` = '%s'",char_db, t_name);
+ sprintf(tmp_sql, "SELECT 1 FROM `%s` WHERE `name` = '%s'",char_db, t_name);
if (mysql_query(&mysql_handle, tmp_sql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);