Houses dosen´t insert into mysql
#1

Code:
  CMD:createhouse(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to log in first.");
    if(PlayerInfo[playerid][pAdmin] >= 7)
	{
		new house[64],Float:pX,Float:pY,Float:pZ,string[128],PropertyString[256],query[500];
		if(sscanf(params, "s[64]", house)) return SendClientMessage(playerid, COLOR_GREY, "Syntax:{FFFFFF} /createhouse [exterior/interior/complete]");
	    if(strcmp(house,"exterior",true) == 0)
		{
		    GetPlayerPos(playerid, pX, pY, pZ);
			SetPVarFloat(playerid, "pHeX", pX);
        	SetPVarFloat(playerid, "pHeY", pY);
        	SetPVarFloat(playerid, "pHeZ", pZ);
			SetPVarInt(playerid, "hExt", 1);
			SendClientMessage(playerid, COLOR_YELLOW, "House exterior position configured.");
		}
		if(strcmp(house,"interior",true) == 0)
		{
		    GetPlayerPos(playerid, pX, pY, pZ);
			SetPVarFloat(playerid, "pHiX", pX);
        	SetPVarFloat(playerid, "pHiY", pY);
        	SetPVarFloat(playerid, "pHiZ", pZ);
			SetPVarInt(playerid, "pHiID", GetPlayerInterior(playerid));
			SetPVarInt(playerid, "pHiVW", housess+1);
        	SetPVarInt(playerid, "hInt", 1);
			SendClientMessage(playerid, COLOR_YELLOW, "House interior position configured.");
		}
		if(strcmp(house,"complete",true) == 0)
		{
		    if(GetPVarInt(playerid, "hExt") != 1 || GetPVarInt(playerid, "hInt") != 1)
				return SendClientMessage(playerid, COLOR_ERROR, "(Error){FFFFFF} You haven't configured either the house exterior or interior. Creation attempt failed.");

			new i = housess+1;
			mysql_format(SQL, query, sizeof(query), "INSERT INTO `houses` (`EnterX`, `EnterY`, `EnterZ`, `Price`) VALUES ('%f', '%f', '%f', '%d')", "x, y, z, price");
			mysql_tquery(SQL, query, "", "");

			HouseInfo[i][hID]                           = i;
	    	HouseInfo[i][hEntrancex]                    = GetPVarFloat(playerid, "pHeX");
			HouseInfo[i][hEntrancey]                    = GetPVarFloat(playerid, "pHeY");
		 	HouseInfo[i][hEntrancez]                    = GetPVarFloat(playerid, "pHeZ");
    		HouseInfo[i][hExitx]                        = GetPVarFloat(playerid, "pHiX");
    		HouseInfo[i][hExity]                        = GetPVarFloat(playerid, "pHiY");
    		HouseInfo[i][hExitz]                        = GetPVarFloat(playerid, "pHiZ");
    		format(HouseInfo[i][hOwner], 64, "AdmBot");
    		format(HouseInfo[i][hDiscription], 64, "House");
    		HouseInfo[i][hValue]						= 1000000;
    		HouseInfo[i][hHel]                          = 0;
    		HouseInfo[i][hMusic]						= 0;
    		HouseInfo[i][hInterior]                     = GetPVarInt(playerid, "pHiID");
    		HouseInfo[i][hLock]                         = 0;
    		HouseInfo[i][hOwned]                        = 1;
    		HouseInfo[i][hRent]                         = 5;
    		HouseInfo[i][hRentabil]                     = 1;
    		HouseInfo[i][hTakings]                      = 0;
    		HouseInfo[i][hLevel]                        = 10;
    		HouseInfo[i][hVirtual]                      = GetPVarInt(playerid, "pHiVW");

    		mysql_format(SQL, query, sizeof(query), "UPDATE `houses` SET `Entrancex`='%f',`Entrancey`='%f',`Entrancez`='%f',`Exitx`='%f',`Exity`='%f',`Exitz`='%f',`Interior`='%d',`Virtual`='%d' WHERE `ID`='%d'", HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez], HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz], HouseInfo[i][hInterior], HouseInfo[i][hVirtual], i);
    		mysql_tquery(SQL, query, "", "");
    		mysql_format(SQL, query, sizeof(query), "UPDATE `users` SET `House`='%d' WHERE `name`='AdmBot'", i);
    		mysql_tquery(SQL, query, "", "");

    		DeletePVar(playerid, "pHeX");
		    DeletePVar(playerid, "pHeY");
		    DeletePVar(playerid, "pHeZ");
		    DeletePVar(playerid, "pHiX");
		    DeletePVar(playerid, "pHeY");
		    DeletePVar(playerid, "pHeZ");
		    DeletePVar(playerid, "pHiID");
		    DeletePVar(playerid, "pHiVW");
		    DeletePVar(playerid, "pExt");
		    DeletePVar(playerid, "pInt");
            Create3DTextLabel(PropertyString, 0x9C0000F7, HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez], 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 100.0);
			format(PropertyString, sizeof(PropertyString),"{FFFFFF}House {B40404}%d \n{B40404}This house is for sale(/buyhouse) ! \n{FFFFFF}Description: {B40404}%s \n{FFFFFF}Price: {B40404}$%s \n{FFFFFF}Level: {B40404}%d",i,HouseInfo[i][hDiscription],FormatNumber(HouseInfo[i][hValue]),HouseInfo[i][hLevel]);
			HouseLabel[i] = Create3DTextLabel(PropertyString, 0x9C0000F7, HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez], 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, 0, 0, 0, 100.0);
			HouseLabel[i] = Create3DTextLabel(PropertyString, 0x008080FF, HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez], 40.0, 0, 0);
			DestroyDynamicPickup(HousePickup[i]);
			HousePickup[i] = AddStaticPickup(1273, 23, HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]);

			SetPlayerInterior(playerid, 0);
			SetPlayerVirtualWorld(playerid, 0);
			SetPlayerPos(playerid, HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]);
			housess++;
			format(string,sizeof(string),"House %d created!",i);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}
	}
	else return SendClientMessage(playerid, COLOR_LIGHTGREEN3, AdminOnly);
	return 1;
}
SQL foto: https://i.imgur.com/7nWoCFa.png
I create the house after the server restart house is deleted!
Reply
#2

pawn Code:
mysql_format(SQL, query, sizeof(query), "INSERT INTO `houses` (`EnterX`, `EnterY`, `EnterZ`, `Price`) VALUES ('%f', '%f', '%f', '%d')", "x, y, z, price");
this should be:

pawn Code:
mysql_format(SQL, query, sizeof(query), "INSERT INTO `houses` (`Entrancex`, `Entrancey`, `Entrancez`, `Prices`) VALUES ('%f', '%f', '%f', '%d')", pX, pY, pZ, price);
You also need to get the player's position before that line and store the position inside variables pX, pY, pZ, or else the query will simply save into the database 3 0.0 floats in the columns for positions.

Also, you need to create the "price" variable because you don't.

I would advise you to try to understand your code, and avoid combining codes from multiple sources into one.
Reply
#3

In Mysql is all: posx = 0 y= 0 z= 0 etc
Reply
#4

Check MySQL logs
Reply
#5

Code:
 RROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'pHealth' in 'field list'
[19:38:20] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'pHealth' in 'field list'
[19:41:12] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[19:41:16] [ERROR] CMySQLQuery::Create - no query and orm object specified
[19:41:48] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'pHealth' in 'field list'
[19:41:53] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'pHealth' in 'field list'
[19:44:04] [ERROR] CMySQLQuery::Create - no query and orm object specified
[19:47:22] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'Products' in 'field list'
[19:47:23] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'Products' in 'field list'
[19:47:26] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'Products' in 'field list'
[19:56:24] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'pHealth' in 'field list'
[19:56:28] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'pHealth' in 'field list'
[20:06:04] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[20:06:10] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[20:06:10] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[20:07:36] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[20:07:36] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[20:09:06] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[20:09:19] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[20:09:19] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[20:10:23] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[21:42:46] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[09:55:30] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[09:56:30] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[10:00:16] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[15:28:46] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[15:35:50] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[15:43:24] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[15:47:01] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[16:01:32] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[16:15:45] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[16:32:12] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[16:37:57] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[17:13:41] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[17:14:40] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'pHealth' in 'field list'
[17:14:44] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'pHealth' in 'field list'
[17:32:52] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[17:33:26] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[17:33:26] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[17:45:10] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'pHealth' in 'field list'
[17:45:13] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'pHealth' in 'field list'
[17:47:18] [ERROR] CMySQLQuery::Create - no query and orm object specified
[17:47:47] [ERROR] CMySQLQuery::Create - no query and orm object specified
[17:48:07] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'Products' in 'field list'
[17:48:11] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'Products' in 'field list'
[17:48:11] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'Products' in 'field list'
[17:48:13] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'Products' in 'field list'
[17:48:55] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[17:48:55] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[17:48:55] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[18:02:32] [ERROR] mysql_tquery - callback parameter count does not match format specifier length
[18:03:07] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'TagType' in 'field list'
[18:06:44] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[18:06:44] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[18:06:44] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[18:06:44] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[18:16:48] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'pHealth' in 'field list'
[18:16:51] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'pHealth' in 'field list'
[18:18:52] [ERROR] CMySQLQuery::Create - no query and orm object specified
[18:18:52] [ERROR] CMySQLQuery::Create - no query and orm object specified
[18:18:52] [ERROR] CMySQLQuery::Create - no query and orm object specified
[18:18:52] [ERROR] CMySQLQuery::Create - no query and orm object specified
[18:19:00] [ERROR] CMySQLQuery::Create - no query and orm object specified
[18:29:28] [ERROR] CMySQLQuery::Create - no query and orm object specified
[18:29:28] [ERROR] CMySQLQuery::Create - no query and orm object specified
[18:29:28] [ERROR] CMySQLQuery::Create - no query and orm object specified
[18:31:20] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'pHealth' in 'field list'
[18:31:23] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'pHealth' in 'field list'
[18:33:40] [ERROR] CMySQLQuery::Create - no query and orm object specified
[18:49:42] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'Products' in 'field list'
[18:49:44] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'Products' in 'field list'
[18:49:46] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'Products' in 'field list'
[18:49:48] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'Products' in 'field list'
[18:49:50] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'Products' in 'field list'
[18:54:45] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'Products' in 'field list'
[18:58:39] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'Products' in 'field list'
[18:58:41] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'Products' in 'field list'
[18:58:47] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'Products' in 'field list'
[19:15:40] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[19:15:52] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[19:15:52] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[19:15:57] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[19:15:57] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[19:15:57] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[19:16:42] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[19:16:42] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[19:16:42] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[19:16:42] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[19:19:08] [ERROR] CMySQLQuery::Create - no query and orm object specified
[19:19:08] [ERROR] CMySQLQuery::Create - no query and orm object specified
[19:19:08] [ERROR] CMySQLQuery::Create - no query and orm object specified
[19:19:08] [ERROR] CMySQLQuery::Create - no query and orm object specified
[19:19:22] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[19:19:55] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[19:19:55] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[19:20:28] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[19:20:55] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[19:20:55] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[19:20:55] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[19:22:06] [ERROR] CMySQLQuery::Execute[()] - (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 '05/04/2019 - 19:22:06', '9', '109.98.166.60')' at line 1
[19:23:37] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[19:23:37] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[19:23:37] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[19:23:37] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[19:26:04] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'Products' in 'field list'
[19:26:05] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'Products' in 'field list'
[19:26:06] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'Products' in 'field list'
[19:26:06] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'Products' in 'field list'
[19:26:07] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'Products' in 'field list'
[19:26:08] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'Products' in 'field list'
[19:26:09] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'Products' in 'field list'
[19:26:10] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'Products' in 'field list'
[19:26:10] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'Products' in 'field list'
[19:30:25] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'Products' in 'field list'
[19:30:32] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'Products' in 'field list'
[19:41:21] [ERROR] CMySQLQuery::Create - no query and orm object specified
[19:41:21] [ERROR] CMySQLQuery::Create - no query and orm object specified
[19:41:21] [ERROR] CMySQLQuery::Create - no query and orm object specified
[19:51:15] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[19:51:15] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[19:51:15] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[19:51:57] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'TagType' in 'field list'
[20:06:53] [ERROR] CMySQLQuery::Create - no query and orm object specified
[20:06:53] [ERROR] CMySQLQuery::Create - no query and orm object specified
[20:06:53] [ERROR] CMySQLQuery::Create - no query and orm object specified
[20:59:25] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[21:03:51] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[21:18:28] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[21:18:28] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[21:48:46] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[21:49:57] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'pHealth' in 'field list'
[21:50:00] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'pHealth' in 'field list'
[21:52:14] [ERROR] CMySQLQuery::Create - no query and orm object specified
[22:06:01] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[22:07:21] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[22:07:21] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[22:09:33] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[22:09:33] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[22:09:45] [ERROR] CMySQLQuery::Create - no query and orm object specified
[22:16:03] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'Products' in 'field list'
[22:16:10] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'Products' in 'field list'
[22:25:13] [ERROR] CMySQLQuery::Create - no query and orm object specified
[22:26:48] [ERROR] CMySQLQuery::Create - no query and orm object specified
[22:27:26] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[22:27:26] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[22:27:26] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[22:28:08] [ERROR] mysql_tquery - callback parameter count does not match format specifier length
[22:34:27] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'pHealth' in 'field list'
[22:34:31] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'pHealth' in 'field list'
[22:37:34] [ERROR] CMySQLQuery::Create - no query and orm object specified
[22:38:05] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[22:38:05] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[22:38:05] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[22:42:06] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[22:42:06] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[22:42:06] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[22:44:55] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[22:44:55] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[22:44:55] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[22:45:51] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[22:45:51] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[22:45:51] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[22:55:32] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'pHealth' in 'field list'
[22:55:33] [ERROR] CMySQLQuery::Execute[()] - (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 ''8287458823FACB8FF918DBFABCD22CCB' at line 1
[22:55:36] [ERROR] CMySQLQuery::Execute[()] - (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 ''8287458823FACB8FF918DBFABCD22CCB' at line 1
[22:56:16] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'pHealth' in 'field list'
[22:56:17] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'pHealth' in 'field list'
[22:57:27] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[22:57:27] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[23:05:37] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[23:05:48] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[23:05:48] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[23:21:12] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[23:21:19] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[23:21:19] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[23:31:19] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[00:13:16] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[00:15:38] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[00:15:38] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[00:18:42] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[00:18:56] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'pHealth' in 'field list'
[00:19:39] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[00:19:48] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[00:19:48] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[00:23:18] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[00:23:18] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[00:23:18] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[00:24:13] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[00:24:13] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[00:33:18] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[00:34:23] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[00:34:23] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[00:48:31] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[00:48:40] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'pHealth' in 'field list'
[00:50:54] [ERROR] CMySQLQuery::Create - no query and orm object specified
[00:54:02] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[00:54:02] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[01:02:46] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[01:02:46] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[01:03:47] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[01:03:57] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[01:03:57] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[01:04:54] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[01:04:54] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[01:49:37] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[12:00:19] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[13:30:16] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[13:38:42] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[13:42:08] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[14:02:06] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'pHealth' in 'field list'
[14:02:09] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'pHealth' in 'field list'
[14:03:18] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'pHealth' in 'field list'
[14:03:24] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'pHealth' in 'field list'
[14:03:59] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[14:03:59] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[14:03:59] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[14:03:59] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[14:04:19] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:08:54] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:13:03] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:13:38] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:13:40] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:16:12] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:16:15] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:18:00] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:18:51] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[14:18:51] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[14:18:51] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[14:25:30] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[14:25:30] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[14:25:30] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[14:25:30] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[14:30:30] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[14:30:30] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[14:30:30] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[14:30:30] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[14:36:40] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:36:40] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:36:40] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:36:40] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:05] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:05] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:05] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:05] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:06] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:06] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:06] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:06] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:06] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:06] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:06] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:06] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:07] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:07] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:07] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:07] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:07] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:07] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:07] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:07] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:09] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:09] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:09] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:09] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:12] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:12] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:12] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:12] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:15] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:15] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:15] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:15] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:16] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:16] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:16] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:16] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:16] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:16] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:16] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:16] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:17] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:17] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:17] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:37:17] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:38:49] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:38:49] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:38:49] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:38:49] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:38:53] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:38:53] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:38:53] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:38:53] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:38:55] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:38:55] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:38:55] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:38:55] [ERROR] CMySQLQuery::Create - no query and orm object specified
[14:42:37] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'TagType' in 'field list'
[14:45:28] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[14:45:28] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[14:45:28] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[14:45:28] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[14:58:24] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[14:58:24] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[14:58:24] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[14:58:24] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[14:59:34] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[14:59:34] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[14:59:34] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[15:00:15] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[15:00:15] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[15:00:15] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[15:00:15] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[15:15:35] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[15:15:35] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[15:15:35] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[15:15:35] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[15:17:48] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[15:17:48] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[15:17:48] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[15:17:48] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[15:24:00] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[15:24:10] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'pHealth' in 'field list'
[15:24:15] [ERROR] CMySQLQuery::Execute[()] - (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 ''6EBE76C9FB411BE97B3B0D48B791A7C9' at line 1
[15:24:18] [ERROR] CMySQLQuery::Execute[()] - (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 ''6EBE76C9FB411BE97B3B0D48B791A7C9' at line 1
[15:25:05] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[15:25:05] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[15:26:28] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'pHealth' in 'field list'
[15:26:36] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'pHealth' in 'field list'
[15:29:18] [ERROR] CMySQLQuery::Create - no query and orm object specified
[15:30:30] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'Products' in 'field list'
[15:52:21] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
A lot of errors
Reply
#6

First of all, start using threaded queries. It's much easier and less complicated, also better.

Second, your code is wrong:

pawn Code:
"x, y, z, price"
You don't need the " " at all, so it should be like this:

pawn Code:
mysql_format(SQL, query, sizeof(query), "INSERT INTO `houses` (`EnterX`, `EnterY`, `EnterZ`, `Price`) VALUES ('%f', '%f', '%f', '%d')", x, y, z, price);
Also, if you want to start using threaded queries, this is how you would do it.

pawn Code:
mysql_tquery(SQL, query, "OnHouseCreated", "i", houseid);
Replace houseid at the end with whatever you defined your house id. Then you make a new function called OnHouseCreated or whatever you want to name it, and set everything there instead of making your code look ugly.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)