SA-MP Forums Archive
How to create these tables through mysql scripting? - 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: How to create these tables through mysql scripting? (/showthread.php?tid=590499)



How to create these tables through mysql scripting? - SwaggySwampMan - 30.09.2015

These tables listed below does not exist in the db. So its the function misc_load is not loading. I know its updating instead of creating /saving

Код:
stock g_mysql_SaveMOTD()
{
	new query[1024];

	format(query, sizeof(query), "UPDATE `misc` SET ");

	format(query, sizeof(query), "%s `gMOTD` = '%s',", query, g_mysql_ReturnEscaped(GlobalMOTD, MainPipeline));
	format(query, sizeof(query), "%s `aMOTD` = '%s',", query, g_mysql_ReturnEscaped(AdminMOTD, MainPipeline));
	format(query, sizeof(query), "%s `vMOTD` = '%s',", query, g_mysql_ReturnEscaped(VIPMOTD, MainPipeline));
	format(query, sizeof(query), "%s `cMOTD` = '%s',", query, g_mysql_ReturnEscaped(CAMOTD, MainPipeline));
	format(query, sizeof(query), "%s `pMOTD` = '%s',", query, g_mysql_ReturnEscaped(pMOTD, MainPipeline));
	format(query, sizeof(query), "%s `ShopTechPay` = '%.2f',", query, ShopTechPay);
	format(query, sizeof(query), "%s `GiftCode` = '%s',", query, g_mysql_ReturnEscaped(GiftCode, MainPipeline));
	format(query, sizeof(query), "%s `GiftCodeBypass` = '%d',", query, GiftCodeBypass);
	format(query, sizeof(query), "%s `TotalCitizens` = '%d',", query, TotalCitizens);
	format(query, sizeof(query), "%s `TRCitizens` = '%d',", query, TRCitizens);
	format(query, sizeof(query), "%s `ShopClosed` = '%d',", query, ShopClosed);
	format(query, sizeof(query), "%s `RimMod` = '%d',", query, RimMod);
	format(query, sizeof(query), "%s `CarVoucher` = '%d',", query, CarVoucher);
	format(query, sizeof(query), "%s `PVIPVoucher` = '%d',", query, PVIPVoucher);
	format(query, sizeof(query), "%s `GarageVW` = '%d',", query, GarageVW);
	format(query, sizeof(query), "%s `PumpkinStock` = '%d',", query, PumpkinStock);
	format(query, sizeof(query), "%s `HalloweenShop` = '%d'", query, HalloweenShop);

	mysql_function_query(MainPipeline, query, false, "OnQueryFinish", "i", SENDDATA_THREAD);
}
So, How do i create these tables? Maybe SQL Query? How, Thanks!!!!!!!!