Create Table error?
#1

Why am I getting this error? It creates the table too and looked in the structure and through the code and it's all correct.

Updated the code but get this:

pawn Код:
[18:40:53] [ERROR] CMySQLQuery::Execute[SendQuery] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CREATE TABLE IF NOT EXISTS `Houses` (`HouseID` INT(4) NOT NULL AUTO_INCREMENT PR' at line 1
[18:40:53] [ERROR] CMySQLQuery::Execute[HousesLoad] - (error #1146) Table 'rp.houses' doesn't exist
pawn Код:
stock Setup()
{
    new query[2000];
    g_Handle = mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS);
   
    strcat(query, "CREATE TABLE IF NOT EXISTS `Accounts` (`ID` INT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY, `Name` VARCHAR(24), `Pass` VARCHAR(129), `Level` INT(20), `Gender` INT(2), `Age` INT(3), `Cash` INT(20), `Bank` INT(20), `BankReg` INT(2), `Skin` INT(4), `AdminLevel` INT(5), `InHouse` INT(3), `House` INT(3), `Accent` INT(3), `Cigarettes` INT(4), `Lighter` INT(3), `Job` INT(3), `SideJob` INT(5),");
    strcat(query, "`SideJob2` INT(5), `Interior` INT(3), `VirtualWorld` INT(4), `Faction` INT(3), `Rank` INT(3), `Health` float, `PosX` float, `PosY` float, `PosZ` float, `PosA` float, `IP` VARCHAR(30))");
    mysql_function_query(g_Handle, query, false, "SendQuery", "");
   
    strcat(query, "CREATE TABLE IF NOT EXISTS `Houses` (`HouseID` INT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY, `Address` VARCHAR(30), `Owner` VARCHAR(30), `Price` INT(8), `EnterX` float, `EnterY` float, `EnterZ` float, `EnterA` float, `ExitX` float, `ExitY` float, `ExitZ` float, `ExitA` float, `Interior` INT(3), `VirtualWorld` INT(3), `Type` INT(3), `Lock` INT(2), `Cash` INT(20),");
    strcat(query, "`Safe` INT(6), `Toilet` INT(6), `Shower` INT(6), `Bath` INT(6), `Cooker` INT(6), `Washer` INT(6), `Fridge` INT(6), `Sink` INT(6), `KitSink` INT(6), `Fryer` INT(6), `Counter` INT(6), `Microwave` INT(6))");
    mysql_function_query(g_Handle, query, false, "SendQuery", "");

    mysql_function_query(g_Handle, "CREATE TABLE IF NOT EXISTS `System` (`HouseID` INT(4))", false, "SendQuery", "");
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)