28.01.2017, 22:11
Depends of the version of MySQL you use. I probably don't use the best way to create table but.. it's a way (Vince will probably say the code sucks and say why, take care of that - he is godlike).
PHP код:
new query[590];
format(query, sizeof(query), "CREATE TABLE IF NOT EXISTS `Tag` (`SQLIB` INTEGER PRIMARY KEY AUTO_INCREMENT, `ID` INT NOT NULL DEFAULT '0', `Owner` VARCHAR(25) NOT NULL DEFAULT '', `Text` VARCHAR(21) NOT NULL DEFAULT '', `x` FLOAT NOT NULL DEFAULT '0.0', `y` FLOAT NOT NULL DEFAULT '0.0', `z` FLOAT NOT NULL DEFAULT '0.0', `rX` FLOAT NOT NULL DEFAULT '0.0'");
strcat(query, ", `rY` FLOAT NOT NULL DEFAULT '0.0', `rZ` FLOAT NOT NULL DEFAULT '0.0', `Police` VARCHAR(31) NOT NULL DEFAULT '', `VirtualWorld` INT NOT NULL DEFAULT '0', `Interior` INT NOT NULL DEFAULT '0', `Exist` INT NOT NULL DEFAULT '0', `Color` INT NOT NULL DEFAULT '0')");
mysql_query(MySQL, query);
mysql_pquery(MySQL, "SELECT * FROM Tag", "OnTagLoading", "");