SA-MP Forums Archive
Mysql Tables not creating up - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Mysql Tables not creating up (/showthread.php?tid=661440)



Mysql Tables not creating up - ZigGamerx - 04.12.2018

Hey people's my Mysql tables are not auto created,

Код:
new qstr[1000];
		new sstr[1000];
		
		strcat(qstr, "CREATE TABLE IF NOT EXISTS");
		strcat(qstr, "players(");
		strcat(qstr, "`Account_ID` INT(20) auto_increment PRIMARY KEY,");
		strcat(qstr, "`Name` VARCHAR(50),");
		strcat(qstr, "`Password` VARCHAR(30),");
		strcat(qstr, "`IP` VARCHAR(16),");
		strcat(qstr, "`Admin` INT(20),");
		strcat(qstr, "`VIP` INT(20),");
		strcat(qstr, "`FreeRoam_Score` INT(20),");
		strcat(qstr, "`Deathmatch_Score` INT(20),");
		strcat(qstr, "`Duel_Score` INT(20),");
		strcat(qstr, "`Deaths` INT(20),");
        strcat(qstr, "`Skin` INT(20),");
		strcat(qstr, "`Pms` INT(20),");
		strcat(qstr, "`Gos` INT(20),");
		strcat(qstr, "`God` INT(20),");
		strcat(qstr, "`Cms` INT(20),");
		strcat(qstr, "`aCMS`, INT(20),");
		strcat(qstr, "`MegaJump` INT(20),");
		strcat(qstr, "`Color` INT(20),");
		strcat(qstr, "`Fighting_Style` INT(20),");
		strcat(qstr, "`BanCount` INT(20),");
		strcat(qstr, "`JailCount` INT(20),");
		strcat(qstr, "`KickCount` INT(20),");
		strcat(qstr, "`MuteCount` INT(20),");
		strcat(qstr, "`ExplodeCount` INT(20),");
		strcat(qstr, "`SlapCount` INT(20),");
        strcat(qstr, "`WeaponRCount` INT(20),");
		strcat(qstr, "`Banned` INT(20),");
		strcat(qstr, "`Jailed` INT(20),");
		strcat(qstr, "`Muted` INT(20),");
		strcat(qstr, "`Frozen` INT(20),");
		strcat(qstr, "`JailTime` INT(20),");
		strcat(qstr, "`Time` INT(20),");
		strcat(qstr, "`Weather` INT(20),");
		strcat(qstr, "`Spawn` INT(20),");
		strcat(qstr, "`Spawn_Interior` INT(20),");
		strcat(qstr, "`Spawn_X` FLOAT(128),");
		strcat(qstr, "`Spawn_Y` FLOAT(128),");
		strcat(qstr, "`Spawn_Z` FLOAT(128),");
		strcat(qstr, "`Spawn_Angle` FLOAT(128))");
		mysql_query(mysql, qstr);
		
		strcat(sstr, "CREATE TABLE IF NOT EXIST ");
		strcat(sstr, "banlog(");
		strcat(sstr, "`Name` VARCHAT(30),");
		strcat(sstr, "`Account_ID` INT(20),");
		strcat(sstr, "`Banned_By` VARCHAR(30),");
		strcat(sstr, "`Type` INT(20),");
		strcat(sstr, "`Reason` VARCHAR(120),");
		strcat(sstr, "`Date` datetime)");
		mysql_query(mysql, sstr);



Re: Mysql Tables not creating up - GTLS - 06.12.2018

Worst way to create table. Just copy your query and paste it in PHPMyAdmin. You should not provide your Table along with your script.