19.03.2012, 18:07
(
Last edited by Unte99; 19/03/2012 at 08:08 PM.
)
A few days ago i started learning mysql. I have heard that mysql is fast, you can make that you could change your player stats from a website. So I decided to give it a shot and try it. Server connects to mysql, but it does not create a table. If I use ~5 variables for the table, mysql creates the table, but if I use ~27 variables, it doesn't create. I tryed using strcat, but no luck. I'm using G_Stylezz mysql plugin. Will it be necessary to create two tables in this case ?
pawn Code:
SetupTable()
{
new query[400];
strcat(query,"CREATE TABLE IF NOT EXISTS `"TABLENAME"`(`id` int(11) NOT NULL auto_increment PRIMARY KEY,`Vardas` varchar(30) NOT NULL,`Slaptazodis` varchar(50) NOT NULL,");
strcat(query,"`Adminas` int(10) NOT NULL default '0',`Pagradm` int(10) NOT NULL default '0',`Meras` int(10) NOT NULL default '0',`Pinigai` int(10) NOT NULL default '0',");
strcat(query,"`XP` int(10) NOT NULL default '0',`Darbas` int(10) NOT NULL default '0',`Persirenges` int(10) NOT NULL default '0',");
strcat(query,"`Direktorius` int(10) NOT NULL default '0',`Uniforma` int(10) NOT NULL default '0',`Bankas` int(10) NOT NULL default '0',`Lytis` int(10) NOT NULL default '0',");
strcat(query,"`Pakviestas` int(10) NOT NULL default '0',`MasinosTeises` int(10) NOT NULL default '0',`MotocikloTeises` int(10) NOT NULL default '0',`SunkvezimioTeises` int(10) NOT NULL default '0',`Teorija` int(10) NOT NULL default '0',`VPRegNumeris` int(10) NOT NULL default '0',");
strcat(query,"`Surakintas` int(10) NOT NULL default '0',`Ieskomumas` int(10) NOT NULL default '0',`Alkis` int(10) NOT NULL default '0',`Irankiai` int(10) NOT NULL default '0',`Kalejimolaikas` int(10) NOT NULL default '0',`Ikalintas` int(10) NOT NULL default '0')");
printf("Lentelės sėkmingai sukurtos.");
return mysql_query(query);
}