SQL_SaveLicenses(playerid)
{
if (!PlayerData[playerid][pLogged])
return 0;
static
query[768];
format(query, sizeof(query), "UPDATE `licenses` SET `licID` = '%d', `ownerID` = '%d', `issuerID` = '%d', `issueDate` = '%s' WHERE `ID` = '%d'",
LicenseData[playerid][licID],
LicenseData[playerid][ownerID],
LicenseData[targetid][issuerID],
LicenseData[playerid][issueDate]
}; // this line
mysql_function_query(g_iHandle, query, false, "", "");
return 1;
} // this line
error 010: invalid function or declaration error 010: invalid function or declaration |
SQL_SaveLicenses(playerid)
{
if (!PlayerData[playerid][pLogged])
return 0;
static
query[768];
format(query, sizeof(query), "UPDATE `licenses` SET `licID` = '%d', `ownerID` = '%d', `issuerID` = '%d', `issueDate` = '%s' WHERE `ID` = '%d'",
LicenseData[playerid][licID],
LicenseData[playerid][ownerID],
LicenseData[targetid][issuerID],
LicenseData[playerid][issueDate]
}; // ----> What is this semicolon? Remove it.
mysql_function_query(g_iHandle, query, false, "", "");
return 1;
}
pawn Код:
|
static
query[768];
SQL_SaveLicenses(playerid)
{
if (!PlayerData[playerid][pLogged])
return 0;
static
query[768];
format(query, sizeof(query), "UPDATE `licenses` SET `licID` = '%d', `ownerID` = '%d', `issuerID` = '%d', `issueDate` = '%s' WHERE `ID` = '%d'",
LicenseData[playerid][licID],
LicenseData[playerid][ownerID],
LicenseData[targetid][issuerID],
LicenseData[playerid][issueDate]
); // ----> What is this semicolon? Remove it.
mysql_function_query(g_iHandle, query, false, "", "");
return 1;
}
Perhaps one of you could answer a question though?
PHP код:
|
format(query, sizeof(query), "UPDATE `licenses` SET `licID` = '%d', `ownerID` = '%d', `issuerID` = '%d', `issueDate` = '%s' WHERE `ID` = '%d'",
LicenseData[playerid][licID],
LicenseData[playerid][ownerID],
LicenseData[targetid][issuerID],
LicenseData[playerid][issueDate]
);
Nope, he should change the curly bracket to a round bracket (because it's meant to close the format function..).
|
PHP код:
|
Whatever you format here will be inserted into `query`. If your intended query is longer than 767 characters, it won't send the full query. Though, your array length should be fine for such short query.
|