Table isn't being created (MYSQL)...
#1

Hey,

I've other table rather than this but it works correctly because it's not that long,
though I split my long input, it's not created.

Here's the query:

pawn Код:
new query[500];
    format(query, sizeof(query), "CREATE TABLE IF NOT EXISTS playerdata(user VARCHAR(24) NOT NULL auto_increment PRIMARY KEY, password VARCHAR(40) NOT NULL,");
    strcat(query, "IP VARCHAR(16) NOT NULL, money INT(20) NOT NULL default '0' , skin INT(10) NOT NULL default '0', scores INT(30) NOT NULL default '0', adminlevel INT(10) NOT NULL default '0', helperlevel INT(10) NOT NULL default '0',");
    strcat(query, "kills INT(20) NOT NULL default '0', deaths INT(20) NOT NULL default '0', floatx INT(20) NOT NULL default '0', floaty INT(20) NOT NULL default '0', floatz INT(20) NOT NULL default '0', floatr INT(20) NOT NULL default '0' )");
    mysql_query(query);
Thanks for any help!
Reply
#2

The size is not enough.

pawn Код:
new query[558] = "CREATE TABLE IF NOT EXISTS playerdata(user VARCHAR(24) NOT NULL auto_increment PRIMARY KEY, password VARCHAR(40) NOT NULL,";
strcat(query, "IP VARCHAR(16) NOT NULL, money INT(20) NOT NULL default '0', skin INT(10) NOT NULL default '0', scores INT(30) NOT NULL default '0', adminlevel INT(10) NOT NULL default '0', helperlevel INT(10) NOT NULL default '0',");
strcat(query, "kills INT(20) NOT NULL default '0', deaths INT(20) NOT NULL default '0', floatx INT(20) NOT NULL default '0', floaty INT(20) NOT NULL default '0', floatz INT(20) NOT NULL default '0', floatr INT(20) NOT NULL default '0')");
Reply
#3

Quote:
Originally Posted by TH3_R3D™
Посмотреть сообщение
new query[500];
This little.

And what about ' ' and ` `?
Reply
#4

no effect!
Reply
#5

The length of the query is 561 characters.

new query[562];
Reply
#6

I hope if you pasted the code I gave to keep the mysql_query line!

print query:
pawn Код:
print(query);
after the mysql_query line and also check the mysql log file for further information.
Reply
#7

Create tables outside of the script. Wasting resources on something that's only to be done once is useless.
Reply
#8

lol, I removed that line "auto_increment PRIMARY KEY" as a result, it worked but what's wrong?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)